+
Error log:
Error {{ error.name }} {{error.validationSummary.message | translate}}
diff --git a/demo-shell/src/app/components/form/form.component.ts b/demo-shell/src/app/components/form/form.component.ts
index f70a8ceb6a..a2c66968fc 100644
--- a/demo-shell/src/app/components/form/form.component.ts
+++ b/demo-shell/src/app/components/form/form.component.ts
@@ -15,8 +15,16 @@
* limitations under the License.
*/
-import { Component, Inject, OnDestroy, OnInit, ViewEncapsulation } from '@angular/core';
-import { FormModel, FormFieldModel, FormService, FormOutcomeEvent, NotificationService, CoreAutomationService, FormRenderingService } from '@alfresco/adf-core';
+import { Component, inject, OnDestroy, OnInit, ViewEncapsulation } from '@angular/core';
+import {
+ FormModel,
+ FormFieldModel,
+ FormService,
+ FormOutcomeEvent,
+ NotificationService,
+ CoreAutomationService,
+ FormRenderingService
+} from '@alfresco/adf-core';
import { ProcessFormRenderingService } from '@alfresco/adf-process-services';
import { InMemoryFormService } from '../../services/in-memory-form.service';
import { Subject } from 'rxjs';
@@ -33,6 +41,10 @@ import { takeUntil } from 'rxjs/operators';
encapsulation: ViewEncapsulation.None
})
export class FormComponent implements OnInit, OnDestroy {
+ private formService = inject(FormService);
+ private notificationService = inject(NotificationService);
+ private automationService = inject(CoreAutomationService);
+
form: FormModel;
errorFields: FormFieldModel[] = [];
formConfig: string;
@@ -49,25 +61,16 @@ export class FormComponent implements OnInit, OnDestroy {
private onDestroy$ = new Subject
();
- constructor(@Inject(FormService) private formService: InMemoryFormService,
- private notificationService: NotificationService,
- private automationService: CoreAutomationService) {
- }
-
logErrors(errorFields: FormFieldModel[]) {
this.errorFields = errorFields;
}
ngOnInit() {
- this.formService.executeOutcome
- .pipe(takeUntil(this.onDestroy$))
- .subscribe((formOutcomeEvent: FormOutcomeEvent) => {
- formOutcomeEvent.preventDefault();
- });
+ this.formService.executeOutcome.pipe(takeUntil(this.onDestroy$)).subscribe((formOutcomeEvent: FormOutcomeEvent) => {
+ formOutcomeEvent.preventDefault();
+ });
- this.formConfig = JSON.stringify(
- this.automationService.forms.getFormDefinition()
- );
+ this.formConfig = JSON.stringify(this.automationService.forms.getFormDefinition());
this.parseForm();
}
diff --git a/demo-shell/src/app/components/process-service/custom-editor/custom-editor.component.ts b/demo-shell/src/app/components/process-service/custom-editor/custom-editor.component.ts
deleted file mode 100644
index ca9316bafb..0000000000
--- a/demo-shell/src/app/components/process-service/custom-editor/custom-editor.component.ts
+++ /dev/null
@@ -1,53 +0,0 @@
-/*!
- * @license
- * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/* eslint-disable */
-
-import { Component, NgModule } from '@angular/core';
-import { WidgetComponent } from '@alfresco/adf-core';
-
-@Component({
- selector: 'custom-editor',
- template: `
- Look, I'm a custom editor!
- `
-})
-export class CustomEditorComponent extends WidgetComponent {
-
- constructor() {
- super();
- }
-}
-
-@Component({
- selector: 'custom-stencil-01',
- template: `ADF version of custom ProcessService stencil
`
-})
-export class CustomStencil01 extends WidgetComponent {
-
- constructor() {
- super();
- }
-}
-
-@NgModule({
- declarations: [ CustomEditorComponent, CustomStencil01 ],
- exports: [ CustomEditorComponent, CustomStencil01 ]
-})
-export class CustomEditorsModule {
-
-}
diff --git a/demo-shell/src/app/components/process-service/process-service.component.html b/demo-shell/src/app/components/process-service/process-service.component.html
index 5b4f3ea667..be580abb80 100644
--- a/demo-shell/src/app/components/process-service/process-service.component.html
+++ b/demo-shell/src/app/components/process-service/process-service.component.html
@@ -50,17 +50,16 @@
class="app-grid-item app-tasks-details"
*ngIf="!isStartTaskMode()"
data-automation-id="app-tasks-details">
-
+
@@ -129,14 +128,12 @@
+ (changePageSize)="onChangePageSize($event)">
();
private scriptFileApi: ScriptFilesApi;
- constructor(private elementRef: ElementRef,
- private route: ActivatedRoute,
- private router: Router,
- private apiService: AlfrescoApiService,
- private appConfig: AppConfigService,
- private preview: PreviewService,
- formRenderingService: FormRenderingService,
- formService: FormService,
- private location: Location,
- private notificationService: NotificationService,
- private preferenceService: UserPreferencesService) {
-
+ constructor(
+ private elementRef: ElementRef,
+ private route: ActivatedRoute,
+ private router: Router,
+ private apiService: AlfrescoApiService,
+ private appConfig: AppConfigService,
+ private preview: PreviewService,
+ formService: FormService,
+ private location: Location,
+ private notificationService: NotificationService,
+ private preferenceService: UserPreferencesService
+ ) {
this.scriptFileApi = new ScriptFilesApi(this.apiService.getInstance());
this.defaultProcessName = this.appConfig.get('adf-start-process.name');
this.defaultProcessDefinitionName = this.appConfig.get('adf-start-process.processDefinitionName');
this.defaultTaskName = this.appConfig.get('adf-start-task.name');
this.processDefinitionName = this.defaultProcessDefinitionName;
- // Uncomment this line to replace all 'text' field editors with custom component
- // formRenderingService.setComponentTypeResolver('text', () => CustomEditorComponent, true);
-
- // Uncomment this line to map 'custom_stencil_01' to local editor component
- formRenderingService.setComponentTypeResolver('custom_stencil_01', () => CustomStencil01, true);
this.preferenceService
.select(UserPreferenceValues.PaginationSize)
@@ -177,22 +149,18 @@ export class ProcessServiceComponent implements AfterViewInit, OnDestroy, OnInit
formService.validateDynamicTableRow
.pipe(takeUntil(this.onDestroy$))
- .subscribe(
- (validateDynamicTableRowEvent: ValidateDynamicTableRowEvent) => {
- const row: DynamicTableRow = validateDynamicTableRowEvent.row;
- if (row?.value && row.value.name === 'admin') {
- validateDynamicTableRowEvent.summary.isValid = false;
- validateDynamicTableRowEvent.summary.message = 'Sorry, wrong value. You cannot use "admin".';
- validateDynamicTableRowEvent.preventDefault();
- }
+ .subscribe((validateDynamicTableRowEvent: ValidateDynamicTableRowEvent) => {
+ const row: DynamicTableRow = validateDynamicTableRowEvent.row;
+ if (row?.value && row.value.name === 'admin') {
+ validateDynamicTableRowEvent.summary.isValid = false;
+ validateDynamicTableRowEvent.summary.message = 'Sorry, wrong value. You cannot use "admin".';
+ validateDynamicTableRowEvent.preventDefault();
}
- );
-
- formService.formContentClicked
- .pipe(takeUntil(this.onDestroy$))
- .subscribe((content) => {
- this.showContentPreview(content);
});
+
+ formService.formContentClicked.pipe(takeUntil(this.onDestroy$)).subscribe((content) => {
+ this.showContentPreview(content);
+ });
}
ngOnInit() {
diff --git a/demo-shell/src/app/components/search/search-filter-chips.component.ts b/demo-shell/src/app/components/search/search-filter-chips.component.ts
index 81692d0781..a3aabada0a 100644
--- a/demo-shell/src/app/components/search/search-filter-chips.component.ts
+++ b/demo-shell/src/app/components/search/search-filter-chips.component.ts
@@ -18,7 +18,7 @@
import { Component, OnDestroy, OnInit } from '@angular/core';
import { ActivatedRoute, Params, Router } from '@angular/router';
import { Pagination, ResultSetPaging } from '@alfresco/js-api';
-import { SearchConfiguration, SearchForm, SearchQueryBuilderService, SearchService } from '@alfresco/adf-content-services';
+import { SearchConfiguration, SearchQueryBuilderService, SearchService } from '@alfresco/adf-content-services';
import { ShowHeaderMode, UserPreferencesService } from '@alfresco/adf-core';
import { combineLatest, Subject } from 'rxjs';
import { takeUntil } from 'rxjs/operators';
@@ -26,11 +26,10 @@ import { takeUntil } from 'rxjs/operators';
@Component({
selector: 'app-search-filter-chips',
templateUrl: './search-filter-chips.component.html',
- styleUrls: [ './search-filter-chips.component.scss' ],
+ styleUrls: ['./search-filter-chips.component.scss'],
providers: [SearchService]
})
export class SearchFilterChipsComponent implements OnInit, OnDestroy {
-
queryParamName = 'q';
searchedWord = '';
data: ResultSetPaging;
@@ -38,15 +37,16 @@ export class SearchFilterChipsComponent implements OnInit, OnDestroy {
isLoading = true;
sorting = ['name', 'asc'];
- searchForms: SearchForm[];
showHeader = ShowHeaderMode.Always;
private onDestroy$ = new Subject();
- constructor(public router: Router,
- private preferences: UserPreferencesService,
- private queryBuilder: SearchQueryBuilderService,
- private route: ActivatedRoute) {
+ constructor(
+ public router: Router,
+ private preferences: UserPreferencesService,
+ private queryBuilder: SearchQueryBuilderService,
+ private route: ActivatedRoute
+ ) {
combineLatest([this.route.params, this.queryBuilder.configUpdated])
.pipe(takeUntil(this.onDestroy$))
.subscribe(([params, searchConfig]) => {
@@ -56,7 +56,7 @@ export class SearchFilterChipsComponent implements OnInit, OnDestroy {
if (query) {
this.queryBuilder.userQuery = query;
}
- });
+ });
queryBuilder.paging = {
maxItems: this.preferences.paginationSize,
@@ -69,21 +69,17 @@ export class SearchFilterChipsComponent implements OnInit, OnDestroy {
this.sorting = this.getSorting();
- this.queryBuilder.updated
- .pipe(takeUntil(this.onDestroy$))
- .subscribe(() => {
- this.sorting = this.getSorting();
- this.isLoading = true;
- });
+ this.queryBuilder.updated.pipe(takeUntil(this.onDestroy$)).subscribe(() => {
+ this.sorting = this.getSorting();
+ this.isLoading = true;
+ });
- this.queryBuilder.executed
- .pipe(takeUntil(this.onDestroy$))
- .subscribe((resultSetPaging: ResultSetPaging) => {
- this.queryBuilder.paging.skipCount = 0;
+ this.queryBuilder.executed.pipe(takeUntil(this.onDestroy$)).subscribe((resultSetPaging: ResultSetPaging) => {
+ this.queryBuilder.paging.skipCount = 0;
- this.onSearchResultLoaded(resultSetPaging);
- this.isLoading = false;
- });
+ this.onSearchResultLoaded(resultSetPaging);
+ this.isLoading = false;
+ });
if (this.route) {
this.route.params.forEach((params: Params) => {
@@ -92,18 +88,20 @@ export class SearchFilterChipsComponent implements OnInit, OnDestroy {
this.queryBuilder.update();
} else {
this.queryBuilder.userQuery = null;
- this.queryBuilder.executed.next(new ResultSetPaging({
- list: {
- pagination: { totalItems: 0 },
- entries: []
- }
- }));
+ this.queryBuilder.executed.next(
+ new ResultSetPaging({
+ list: {
+ pagination: { totalItems: 0 },
+ entries: []
+ }
+ })
+ );
}
});
}
}
- private formatSearchQuery(userInput: string, fields = ['cm:name']) {
+ private formatSearchQuery(userInput: string, fields = ['cm:name']) {
if (!userInput) {
return null;
}
diff --git a/docs/content-services/components/add-permission-dialog.component.md b/docs/content-services/components/add-permission-dialog.component.md
index 18bbd744ab..2453ce2b49 100644
--- a/docs/content-services/components/add-permission-dialog.component.md
+++ b/docs/content-services/components/add-permission-dialog.component.md
@@ -2,10 +2,12 @@
Title: Add Permission Dialog Component
Added: v2.4.0
Status: Active
-Last reviewed: 2018-11-13
+Last reviewed: 2024-05-07
---
-# [Add Permission Dialog Component](../../../lib/content-services/src/lib/permission-manager/components/add-permission/add-permission-dialog.component.ts "Defined in add-permission-dialog.component.ts")
+# Add Permission Dialog Component
+
+`import { NodePermissionDialogService } from '@alfresco/adf-content-services';`
Displays a dialog to search for people or groups to add to the current node permissions.
@@ -15,41 +17,53 @@ Displays a dialog to search for people or groups to add to the current node perm
```ts
import { NodePermissionDialogService } from '@alfresco/adf-content-services';
+import { inject } from '@angular/core';
- constructor(private nodePermissionDialogService: nodePermissionDialogService) {
+export class MyComponent {
+ private nodePermissionDialogService = inject(NodePermissionDialogService);
+
+ showDialog() {
+ this.nodePermissionDialogService
+ .openAddPermissionDialog(this.nodeId)
+ .subscribe((selectedNodes) => {
+ //action for selected nodes
+ },
+ (error) => {
+ this.showErrorMessage(error);
+ });
}
-
- this.nodePermissionDialogService.openAddPermissionDialog(this.nodeId).subscribe((selectedNodes) => {
- //action for selected nodes
- },
- (error) => {
- this.showErrorMessage(error);
- });
+}
```
## Details
This component extends the [Add permission panel component](add-permission-panel.component.md)
to apply the chosen selection of permissions when they are accepted.
+
You can open the dialog with the `openAddPermissionDialog` method from the
[Node Permission Dialog Service](../services/node-permission-dialog.service.md).
This returns an [`Observable`](http://reactivex.io/documentation/observable.html)
-that you can subscribe to so you can get the details of the node after the update.
-Use the `updateNodePermissionByDialog` nethod from the service to update node permissions, as shown in
+that you can subscribe to, so you can get the details of the node after the update.
+
+Use the `updateNodePermissionByDialog` method from the service to update node permissions, as shown in
the following example:
```ts
import { NodePermissionDialogService } from '@alfresco/adf-content-services';
+import { inject } from '@angular/core';
- constructor(private nodePermissionDialogService: nodePermissionDialogService) {
+export class MyComponent {
+ private nodePermissionDialogService = inject(NodePermissionDialogService);
+
+ updateNodePermissions() {
+ this.nodePermissionDialogService.updateNodePermissionByDialog(this.nodeId).subscribe((node) => {
+ //updated node
+ },
+ (error) => {
+ this.showErrorMessage(error);
+ });
}
-
- this.nodePermissionDialogService.updateNodePermissionByDialog(this.nodeId).subscribe((node) => {
- //updated node
- },
- (error) => {
- this.showErrorMessage(error);
- });
+}
```
## See also
diff --git a/docs/content-services/components/aspect-list.component.md b/docs/content-services/components/aspect-list.component.md
index 3b79c983b5..c413afa02d 100644
--- a/docs/content-services/components/aspect-list.component.md
+++ b/docs/content-services/components/aspect-list.component.md
@@ -2,42 +2,52 @@
Title: Aspect List component
Added: v2.0.0
Status: Active
-Last reviewed: 2021-01-20
+Last reviewed: 2024-05-07
---
-# [Aspect List component](../../../lib/content-services/src/lib/aspect-list/aspect-list.component.ts "Defined in aspect-list.component.ts")
+# Aspect List Component
+
+`import { AspectListComponent } from '@alfresco/adf-content-services';`
This component will show in an expandable row list with checkboxes all the aspect of a node, if a node id is given, or otherwise a complete list.
-The aspect are filtered via the app.config.json in this way :
+
+The aspects are filtered via the `app.config.json` in the following way :
```json
- "aspect-visible": {
- "default" : ["as:aspectThatWillBeShowedIfPresent"]
- }
+{
+ "aspect-visible": {
+ "default": [
+ "as:aspectThatWillBeShowedIfPresent"
+ ]
+ }
+}
```
## Basic Usage
```html
-
-
+
+
```
## Class members
### Properties
-| Name | Type | Default value | Description |
-| ---- | ---- | ------------- | ----------- |
-| nodeId | `string` | "" | Node Id of the node that we want to update |
-| excludedAspects | `string[]` | undefined | List of aspects' ids which should not be displayed. |
+| Name | Type | Default value | Description |
+|-----------------|------------|---------------|-----------------------------------------------------|
+| nodeId | `string` | "" | Node Id of the node that we want to update |
+| excludedAspects | `string[]` | undefined | List of aspects' ids which should not be displayed. |
### Events
-| Name | Type | Description |
-| ---- | ---- | ----------- |
-| valueChanged | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`` | Emitted every time the user select a new aspect |
-| updateCounter | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`` | Emitted every time the number of selected aspects changes |
+| Name | Type | Description |
+|---------------|------------------------------------------------------------------------|-----------------------------------------------------------|
+| valueChanged | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`` | Emitted every time the user select a new aspect |
+| updateCounter | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`` | Emitted every time the number of selected aspects changes |
## See also
diff --git a/lib/cli/scripts/licenses.ts b/lib/cli/scripts/licenses.ts
index 45e99d5889..0cb42e25cf 100644
--- a/lib/cli/scripts/licenses.ts
+++ b/lib/cli/scripts/licenses.ts
@@ -50,8 +50,6 @@ const missingRepositories = {
'@webassemblyjs/helper-fsm': 'https://github.com/xtuc/webassemblyjs',
'@webassemblyjs/ieee754': 'https://github.com/xtuc/webassemblyjs',
'@webassemblyjs/leb128': 'https://github.com/xtuc/webassemblyjs',
- 'adf-tslint-rules': 'https://github.com/Alfresco/alfresco-ng2-components',
- 'adf-monaco-extension': 'https://github.com/eromano/aca-monaco-extension',
indexof: 'https://github.com/component/indexof',
'rxjs-compat': 'https://github.com/ReactiveX/rxjs/tree/master/compat'
};
diff --git a/lib/process-services/src/lib/task-list/components/checklist.component.ts b/lib/process-services/src/lib/task-list/components/checklist.component.ts
index 3f9d25e894..e61c9ede54 100644
--- a/lib/process-services/src/lib/task-list/components/checklist.component.ts
+++ b/lib/process-services/src/lib/task-list/components/checklist.component.ts
@@ -62,7 +62,7 @@ export class ChecklistComponent implements OnChanges {
checklist: TaskDetailsModel[] = [];
- constructor(private activitiTaskList: TaskListService, private dialog: MatDialog) {}
+ constructor(private taskListService: TaskListService, private dialog: MatDialog) {}
ngOnChanges(changes: SimpleChanges) {
const taskId = changes['taskId'];
@@ -75,7 +75,7 @@ export class ChecklistComponent implements OnChanges {
getTaskChecklist() {
this.checklist = [];
if (this.taskId) {
- this.activitiTaskList.getTaskChecklist(this.taskId).subscribe(
+ this.taskListService.getTaskChecklist(this.taskId).subscribe(
(taskDetailsModel) => {
taskDetailsModel.forEach((task) => {
this.checklist.push(task);
@@ -100,7 +100,7 @@ export class ChecklistComponent implements OnChanges {
parentTaskId: this.taskId,
assignee: { id: this.assignee }
});
- this.activitiTaskList.addTask(newTask).subscribe(
+ this.taskListService.addTask(newTask).subscribe(
(taskDetailsModel) => {
this.checklist.push(taskDetailsModel);
this.checklistTaskCreated.emit(taskDetailsModel);
@@ -114,7 +114,7 @@ export class ChecklistComponent implements OnChanges {
}
public delete(taskId: string) {
- this.activitiTaskList.deleteTask(taskId).subscribe(
+ this.taskListService.deleteTask(taskId).subscribe(
() => {
this.checklist = this.checklist.filter((check) => check.id !== taskId);
this.checklistTaskDeleted.emit(taskId);
diff --git a/lib/process-services/src/lib/task-list/components/task-details.component.html b/lib/process-services/src/lib/task-list/components/task-details.component.html
index e1b64b52eb..f0dae0ab7c 100644
--- a/lib/process-services/src/lib/task-list/components/task-details.component.html
+++ b/lib/process-services/src/lib/task-list/components/task-details.component.html
@@ -18,7 +18,7 @@