mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-12 17:04:57 +00:00
Cleanup process services project structure (#9838)
This commit is contained in:
parent
672f6347d0
commit
d9c014a1f0
@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { Component, Input, OnChanges, OnDestroy, OnInit, ViewChild, ViewEncapsulation } from '@angular/core';
|
||||
import { Component, inject, Input, OnChanges, OnDestroy, OnInit, ViewChild, ViewEncapsulation } from '@angular/core';
|
||||
import { ProcessAttachmentListComponent, ProcessService, ProcessUploadService } from '@alfresco/adf-process-services';
|
||||
import { UploadService } from '@alfresco/adf-content-services';
|
||||
import { PreviewService } from '../../services/preview.service';
|
||||
@ -27,12 +27,7 @@ import { ProcessInstanceRepresentation } from '@alfresco/js-api';
|
||||
selector: 'app-process-attachments',
|
||||
templateUrl: './process-attachments.component.html',
|
||||
styleUrls: ['./process-attachments.component.css'],
|
||||
providers: [
|
||||
{
|
||||
provide: UploadService,
|
||||
useClass: ProcessUploadService
|
||||
}
|
||||
],
|
||||
providers: [{ provide: UploadService, useClass: ProcessUploadService }],
|
||||
encapsulation: ViewEncapsulation.None
|
||||
})
|
||||
export class ProcessAttachmentsComponent implements OnInit, OnChanges, OnDestroy {
|
||||
@ -44,9 +39,11 @@ export class ProcessAttachmentsComponent implements OnInit, OnChanges, OnDestroy
|
||||
|
||||
processInstance: ProcessInstanceRepresentation;
|
||||
|
||||
private onDestroy$ = new Subject<boolean>();
|
||||
private uploadService = inject(UploadService);
|
||||
private processService = inject(ProcessService);
|
||||
private preview = inject(PreviewService);
|
||||
|
||||
constructor(private uploadService: UploadService, private processService: ProcessService, private preview: PreviewService) {}
|
||||
private onDestroy$ = new Subject<boolean>();
|
||||
|
||||
ngOnInit() {
|
||||
this.uploadService.fileUploadComplete.pipe(takeUntil(this.onDestroy$)).subscribe((value) => this.onFileUploadComplete(value.data));
|
||||
|
@ -15,39 +15,20 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { Component, Input, OnChanges, OnDestroy, OnInit, ViewChild, ViewEncapsulation } from '@angular/core';
|
||||
import { Component, inject, Input, OnChanges, OnDestroy, OnInit, ViewChild, ViewEncapsulation } from '@angular/core';
|
||||
import { TaskAttachmentListComponent, TaskListService, TaskUploadService } from '@alfresco/adf-process-services';
|
||||
import { AlfrescoApiService, AppConfigService } from '@alfresco/adf-core';
|
||||
import { DiscoveryApiService, UploadService } from '@alfresco/adf-content-services';
|
||||
import { UploadService } from '@alfresco/adf-content-services';
|
||||
import { PreviewService } from '../../services/preview.service';
|
||||
import { Subject } from 'rxjs';
|
||||
import { takeUntil } from 'rxjs/operators';
|
||||
import { TaskRepresentation } from '@alfresco/js-api';
|
||||
|
||||
/**
|
||||
* Provide a task upload service factory
|
||||
*
|
||||
* @param api api client
|
||||
* @param config config service
|
||||
* @param discoveryApiService discovery service
|
||||
* @returns factory function
|
||||
*/
|
||||
export function taskUploadServiceFactory(api: AlfrescoApiService, config: AppConfigService, discoveryApiService: DiscoveryApiService) {
|
||||
return new TaskUploadService(api, config, discoveryApiService);
|
||||
}
|
||||
|
||||
@Component({
|
||||
selector: 'app-task-attachments',
|
||||
templateUrl: './task-attachments.component.html',
|
||||
styleUrls: ['./task-attachments.component.css'],
|
||||
encapsulation: ViewEncapsulation.None,
|
||||
providers: [
|
||||
{
|
||||
provide: UploadService,
|
||||
useFactory: taskUploadServiceFactory,
|
||||
deps: [AlfrescoApiService, AppConfigService, DiscoveryApiService]
|
||||
}
|
||||
]
|
||||
providers: [{ provide: UploadService, useClass: TaskUploadService }]
|
||||
})
|
||||
export class TaskAttachmentsComponent implements OnInit, OnChanges, OnDestroy {
|
||||
@ViewChild('taskAttachList')
|
||||
@ -58,9 +39,11 @@ export class TaskAttachmentsComponent implements OnInit, OnChanges, OnDestroy {
|
||||
|
||||
taskDetails: TaskRepresentation;
|
||||
|
||||
private onDestroy$ = new Subject<boolean>();
|
||||
private uploadService = inject(UploadService);
|
||||
private taskListService = inject(TaskListService);
|
||||
private previewService = inject(PreviewService);
|
||||
|
||||
constructor(private uploadService: UploadService, private taskListService: TaskListService, private previewService: PreviewService) {}
|
||||
private onDestroy$ = new Subject<boolean>();
|
||||
|
||||
ngOnInit() {
|
||||
this.uploadService.fileUploadComplete.pipe(takeUntil(this.onDestroy$)).subscribe((event) => this.onFileUploadComplete(event.data));
|
||||
|
@ -229,7 +229,7 @@ The model to update the DataTable require the ID of the row you want change and
|
||||
| [Notification Service](core/services/notification.service.md) | Shows a notification message with optional feedback. | [Source](../lib/core/src/lib/notifications/services/notification.service.ts) |
|
||||
| [Page Title service](core/services/page-title.service.md) | Sets the page title. | [Source](../lib/core/src/lib/common/services/page-title.service.ts) |
|
||||
| [People Content service](core/services/people-content.service.md) | Gets information about a Content Services user. | [Source](../lib/content-services/src/lib/common/services/people-content.service.ts) |
|
||||
| [People Process service](core/services/people-process.service.md) | Gets information about Process Services users. | [Source](../lib/process-services/src/lib/common/services/people-process.service.ts) |
|
||||
| [People Process service](core/services/people-process.service.md) | Gets information about Process Services users. | [Source](../lib/process-services/src/lib/services/people-process.service.ts) |
|
||||
| [Process Content Service](core/services/process-content.service.md) | Manipulates content related to a Process Instance or Task Instance in APS. | [Source](../lib/process-services/src/lib/form/services/process-content.service.ts) |
|
||||
| [Renditions service](core/services/renditions.service.md) | Manages prearranged conversions of content to different formats. | [Source](../lib/core/src/lib/services/renditions.service.ts) |
|
||||
| [Search Configuration service](core/services/search-configuration.service.md) | Provides fine control of parameters to a search. | [Source](../lib/content-services/src/lib/search/services/search-configuration.service.ts) |
|
||||
@ -394,7 +394,7 @@ for more information about installing and using the source code.
|
||||
| [Security Controls service](content-services/services/security-controls.service.md) | Manages security groups & marks in Content Services. | [Source](../lib/content-services/src/lib/security/services/security-controls-groups-marks-security.service.ts) |
|
||||
| [Sites service](content-services/services/sites.service.md) | Accesses and manipulates sites from a Content Services repository. | [Source](../lib/content-services/src/lib/common/services/sites.service.ts) |
|
||||
| [Tag service](content-services/services/tag.service.md) | Manages tags in Content Services. | [Source](../lib/content-services/src/lib/tag/services/tag.service.ts) |
|
||||
| [Task Comments service](content-services/services/task-comments.service.md) | Adds and retrieves comments for task and process instances in Process Services. | [Source](../lib/process-services/src/lib/task-comments/task-comments.service.ts) |
|
||||
| [Task Comments service](content-services/services/task-comments.service.md) | Adds and retrieves comments for task and process instances in Process Services. | [Source](../lib/process-services/src/lib/services/task-comments.service.ts) |
|
||||
|
||||
<!--content-services end-->
|
||||
|
||||
|
@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { EventEmitter, Injectable } from '@angular/core';
|
||||
import { EventEmitter, inject, Injectable } from '@angular/core';
|
||||
import { Minimatch } from 'minimatch';
|
||||
import { Subject } from 'rxjs';
|
||||
import { FileUploadCompleteEvent, FileUploadDeleteEvent, FileUploadErrorEvent, FileUploadEvent } from '../events/file.event';
|
||||
@ -73,11 +73,11 @@ export class UploadService {
|
||||
return this._versionsApi;
|
||||
}
|
||||
|
||||
constructor(
|
||||
protected apiService: AlfrescoApiService,
|
||||
private appConfigService: AppConfigService,
|
||||
private discoveryApiService: DiscoveryApiService
|
||||
) {
|
||||
protected apiService = inject(AlfrescoApiService);
|
||||
protected appConfigService = inject(AppConfigService);
|
||||
protected discoveryApiService = inject(DiscoveryApiService);
|
||||
|
||||
constructor() {
|
||||
this.discoveryApiService.ecmProductInfo$.pipe(filter((info) => !!info)).subscribe(({ status }) => {
|
||||
this.isThumbnailGenerationEnabled = status.isThumbnailGenerationEnabled;
|
||||
});
|
||||
|
@ -20,7 +20,7 @@ import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { AppsProcessService } from '../services/apps-process.service';
|
||||
import { of, throwError } from 'rxjs';
|
||||
import { defaultApp, deployedApps, nonDeployedApps } from '../mock/apps-list.mock';
|
||||
import { defaultApp, deployedApps, nonDeployedApps } from '../testing/mock/apps-list.mock';
|
||||
import { AppsListComponent, APP_LIST_LAYOUT_GRID, APP_LIST_LAYOUT_LIST } from './apps-list.component';
|
||||
import { ProcessTestingModule } from '../testing/process.testing.module';
|
||||
import { HarnessLoader } from '@angular/cdk/testing';
|
||||
|
@ -20,7 +20,7 @@ import { TestBed, ComponentFixture } from '@angular/core/testing';
|
||||
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
|
||||
import { OverlayContainer } from '@angular/cdk/overlay';
|
||||
import { AppsProcessService } from '../../services/apps-process.service';
|
||||
import { deployedApps } from '../../mock/apps-list.mock';
|
||||
import { deployedApps } from '../../testing/mock/apps-list.mock';
|
||||
import { of } from 'rxjs';
|
||||
import { SelectAppsDialogComponent } from './select-apps-dialog.component';
|
||||
import { ProcessTestingModule } from '../../testing/process.testing.module';
|
||||
|
@ -21,7 +21,7 @@ import { By } from '@angular/platform-browser';
|
||||
import { of, throwError } from 'rxjs';
|
||||
import { ProcessAttachmentListComponent } from './process-attachment-list.component';
|
||||
import { ProcessTestingModule } from '../../testing/process.testing.module';
|
||||
import { mockEmittedProcessAttachments, mockProcessAttachments } from '../../mock/process/process-attachments.mock';
|
||||
import { mockEmittedProcessAttachments, mockProcessAttachments } from '../../testing/mock/process/process-attachments.mock';
|
||||
import { ProcessContentService } from '../../form/services/process-content.service';
|
||||
import { HarnessLoader } from '@angular/cdk/testing';
|
||||
import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed';
|
||||
|
@ -21,7 +21,7 @@ import { By } from '@angular/platform-browser';
|
||||
import { of, throwError } from 'rxjs';
|
||||
import { TaskAttachmentListComponent } from './task-attachment-list.component';
|
||||
import { ProcessTestingModule } from '../../testing/process.testing.module';
|
||||
import { mockEmittedTaskAttachments, mockTaskAttachments } from '../../mock/task/task-attachments.mock';
|
||||
import { mockEmittedTaskAttachments, mockTaskAttachments } from '../../testing/mock/task/task-attachments.mock';
|
||||
import { ProcessContentService } from '../../form/services/process-content.service';
|
||||
import { HarnessLoader } from '@angular/cdk/testing';
|
||||
import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed';
|
||||
|
@ -1,18 +0,0 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright © 2005-2024 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.
|
||||
*/
|
||||
|
||||
export * from './services/people-process.service';
|
@ -19,7 +19,7 @@ import { of, timer } from 'rxjs';
|
||||
import { FormFieldModel, FormModel, GroupModel, CoreTestingModule, FormFieldTypes } from '@alfresco/adf-core';
|
||||
import { FunctionalGroupWidgetComponent } from './functional-group.widget';
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { PeopleProcessService } from '../../../common/services/people-process.service';
|
||||
import { PeopleProcessService } from '../../../services/people-process.service';
|
||||
|
||||
describe('FunctionalGroupWidgetComponent', () => {
|
||||
let fixture: ComponentFixture<FunctionalGroupWidgetComponent>;
|
||||
|
@ -22,7 +22,7 @@ import { ErrorWidgetComponent, FormService, GroupModel, WidgetComponent } from '
|
||||
import { catchError, debounceTime, filter, switchMap, tap } from 'rxjs/operators';
|
||||
import { merge, of } from 'rxjs';
|
||||
import { ReactiveFormsModule, UntypedFormControl } from '@angular/forms';
|
||||
import { PeopleProcessService } from '../../../common/services/people-process.service';
|
||||
import { PeopleProcessService } from '../../../services/people-process.service';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { MatFormFieldModule } from '@angular/material/form-field';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
|
@ -21,7 +21,7 @@ import { FormFieldTypes, FormFieldModel, FormModel, CoreTestingModule } from '@a
|
||||
import { Observable, of } from 'rxjs';
|
||||
import { PeopleWidgetComponent } from './people.widget';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
import { PeopleProcessService } from '../../../common/services/people-process.service';
|
||||
import { PeopleProcessService } from '../../../services/people-process.service';
|
||||
import { LightUserRepresentation } from '@alfresco/js-api';
|
||||
|
||||
describe('PeopleWidgetComponent', () => {
|
||||
|
@ -22,7 +22,7 @@ import { Component, ElementRef, EventEmitter, OnInit, Output, ViewChild, ViewEnc
|
||||
import { ReactiveFormsModule, UntypedFormControl } from '@angular/forms';
|
||||
import { Observable, of } from 'rxjs';
|
||||
import { catchError, distinctUntilChanged, map, switchMap, tap } from 'rxjs/operators';
|
||||
import { PeopleProcessService } from '../../../common/services/people-process.service';
|
||||
import { PeopleProcessService } from '../../../services/people-process.service';
|
||||
import { LightUserRepresentation } from '@alfresco/js-api';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
|
@ -1,18 +0,0 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright © 2005-2024 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.
|
||||
*/
|
||||
|
||||
export * from './public-api';
|
@ -22,7 +22,7 @@ import { debounceTime, switchMap } from 'rxjs/operators';
|
||||
import { Observable, of } from 'rxjs';
|
||||
import { PerformSearchCallback } from '../../interfaces/perform-search-callback.interface';
|
||||
import { getDisplayUser } from '../../helpers/get-display-user';
|
||||
import { PeopleProcessService } from '../../../common/services/people-process.service';
|
||||
import { PeopleProcessService } from '../../../services/people-process.service';
|
||||
import { LightUserRepresentation } from '@alfresco/js-api';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { MatFormFieldModule } from '@angular/material/form-field';
|
||||
|
@ -20,7 +20,7 @@ import { PeopleSelectorComponent } from './people-selector.component';
|
||||
import { of } from 'rxjs';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { ProcessTestingModule } from '../../../testing/process.testing.module';
|
||||
import { PeopleProcessService } from '../../../common/services/people-process.service';
|
||||
import { PeopleProcessService } from '../../../services/people-process.service';
|
||||
|
||||
describe('PeopleSelectorComponent', () => {
|
||||
let component: PeopleSelectorComponent;
|
||||
|
@ -22,7 +22,7 @@ import { PeopleSearchFieldComponent } from '../people-search-field/people-search
|
||||
import { getDisplayUser } from '../../helpers/get-display-user';
|
||||
import { Observable, of } from 'rxjs';
|
||||
import { catchError } from 'rxjs/operators';
|
||||
import { PeopleProcessService } from '../../../common/services/people-process.service';
|
||||
import { PeopleProcessService } from '../../../services/people-process.service';
|
||||
import { LightUserRepresentation } from '@alfresco/js-api';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { MatButtonModule } from '@angular/material/button';
|
||||
|
@ -20,7 +20,7 @@ import { Observable, Observer } from 'rxjs';
|
||||
import { UserEventModel } from '../../../task-list/models/user-event.model';
|
||||
import { PeopleSearchComponent } from '../people-search/people-search.component';
|
||||
import { share } from 'rxjs/operators';
|
||||
import { PeopleProcessService } from '../../../common/services/people-process.service';
|
||||
import { PeopleProcessService } from '../../../services/people-process.service';
|
||||
import { LightUserRepresentation } from '@alfresco/js-api';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { MatCardModule } from '@angular/material/card';
|
||||
|
@ -21,7 +21,7 @@ import { of, throwError } from 'rxjs';
|
||||
import { CommentProcessService } from './services/comment-process.service';
|
||||
import { ProcessCommentsComponent } from './process-comments.component';
|
||||
import { ProcessTestingModule } from '../testing/process.testing.module';
|
||||
import { mockProcessInstanceComments } from '../mock/process/process-comments.mock';
|
||||
import { mockProcessInstanceComments } from '../testing/mock/process/process-comments.mock';
|
||||
|
||||
describe('ProcessCommentsComponent', () => {
|
||||
let component: ProcessCommentsComponent;
|
||||
|
@ -20,7 +20,7 @@ import { Observable, from } from 'rxjs';
|
||||
import { CommentModel, AlfrescoApiService, CommentsService, User } from '@alfresco/adf-core';
|
||||
import { map } from 'rxjs/operators';
|
||||
import { ActivitiCommentsApi } from '@alfresco/js-api';
|
||||
import { PeopleProcessService } from '../../common/services/people-process.service';
|
||||
import { PeopleProcessService } from '../../services/people-process.service';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
|
@ -20,8 +20,8 @@ import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { of } from 'rxjs';
|
||||
import { CommentProcessService } from '../../../process-comments/services/comment-process.service';
|
||||
import { exampleProcess, exampleProcessNoName, mockRunningProcess, processEnded } from '../../../mock';
|
||||
import { mockProcessInstanceComments } from '../../../mock/process/process-comments.mock';
|
||||
import { exampleProcess, exampleProcessNoName, mockRunningProcess, processEnded } from '../../../testing/mock';
|
||||
import { mockProcessInstanceComments } from '../../../testing/mock/process/process-comments.mock';
|
||||
import { ProcessService } from '../../services/process.service';
|
||||
import { ProcessInstanceDetailsComponent } from './process-instance-details.component';
|
||||
import { ProcessTestingModule } from '../../../testing/process.testing.module';
|
||||
|
@ -17,7 +17,7 @@
|
||||
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { AppConfigService } from '@alfresco/adf-core';
|
||||
import { exampleProcess } from '../../../mock';
|
||||
import { exampleProcess } from '../../../testing/mock';
|
||||
import { ProcessInstanceHeaderComponent } from './process-instance-header.component';
|
||||
import { ProcessTestingModule } from '../../../testing/process.testing.module';
|
||||
|
||||
|
@ -19,7 +19,7 @@ import { SimpleChange } from '@angular/core';
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { of } from 'rxjs';
|
||||
import { taskDetailsMock } from '../../../mock';
|
||||
import { taskDetailsMock } from '../../../testing/mock';
|
||||
import { ProcessService } from '../../services/process.service';
|
||||
import { ProcessInstanceTasksComponent } from './process-instance-tasks.component';
|
||||
import { ProcessTestingModule } from '../../../testing/process.testing.module';
|
||||
|
@ -30,7 +30,7 @@ import {
|
||||
DataCellEvent,
|
||||
ObjectDataColumn
|
||||
} from '@alfresco/adf-core';
|
||||
import { fakeProcessInstance, fakeProcessInstancesWithNoName, fakeProcessInstancesEmpty, fakeProcessColumnSchema } from '../../../mock';
|
||||
import { fakeProcessInstance, fakeProcessInstancesWithNoName, fakeProcessInstancesEmpty, fakeProcessColumnSchema } from '../../../testing/mock';
|
||||
import { ProcessService } from '../../services/process.service';
|
||||
import { ProcessTestingModule } from '../../../testing/process.testing.module';
|
||||
import { HarnessLoader } from '@angular/cdk/testing';
|
||||
|
@ -22,10 +22,17 @@ import { AppsProcessService } from '../../../services/apps-process.service';
|
||||
import { of, throwError } from 'rxjs';
|
||||
import { MatSelectChange } from '@angular/material/select';
|
||||
import { ProcessService } from '../../services/process.service';
|
||||
import { newProcess, taskFormMock, testProcessDef, testMultipleProcessDefs, testProcessDefWithForm, testProcessDefinitions } from '../../../mock';
|
||||
import {
|
||||
newProcess,
|
||||
taskFormMock,
|
||||
testProcessDef,
|
||||
testMultipleProcessDefs,
|
||||
testProcessDefWithForm,
|
||||
testProcessDefinitions
|
||||
} from '../../../testing/mock';
|
||||
import { StartProcessInstanceComponent } from './start-process.component';
|
||||
import { ProcessTestingModule } from '../../../testing/process.testing.module';
|
||||
import { deployedApps } from '../../../mock/apps-list.mock';
|
||||
import { deployedApps } from '../../../testing/mock/apps-list.mock';
|
||||
import { ActivitiContentService } from '../../../form/services/activiti-alfresco.service';
|
||||
import { HarnessLoader } from '@angular/cdk/testing';
|
||||
import { MatFormFieldHarness } from '@angular/material/form-field/testing';
|
||||
|
@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
import { exampleProcess } from '../../mock';
|
||||
import { exampleProcess } from '../../testing/mock';
|
||||
import { ProcessService } from './process.service';
|
||||
import { CoreModule, DateFnsUtils } from '@alfresco/adf-core';
|
||||
import { ProcessTestingModule } from '../../testing/process.testing.module';
|
||||
|
@ -20,7 +20,7 @@ import { EcmUserModel, PeopleContentService } from '@alfresco/adf-content-servic
|
||||
import { Component, Input, OnDestroy, ViewChild, ViewEncapsulation } from '@angular/core';
|
||||
import { MatMenuModule, MatMenuTrigger, MenuPositionX, MenuPositionY } from '@angular/material/menu';
|
||||
import { Subject } from 'rxjs';
|
||||
import { PeopleProcessService } from '../common/services/people-process.service';
|
||||
import { PeopleProcessService } from '../services/people-process.service';
|
||||
import { UserRepresentation } from '@alfresco/js-api';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { MatButtonModule } from '@angular/material/button';
|
||||
|
@ -17,10 +17,10 @@
|
||||
|
||||
import { AlfrescoApiService, CommentModel, CommentsService } from '@alfresco/adf-core';
|
||||
import { ActivitiCommentsApi } from '@alfresco/js-api';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { inject, Injectable } from '@angular/core';
|
||||
import { from, Observable } from 'rxjs';
|
||||
import { map } from 'rxjs/operators';
|
||||
import { PeopleProcessService } from '../common/services/people-process.service';
|
||||
import { PeopleProcessService } from './people-process.service';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
@ -32,7 +32,8 @@ export class TaskCommentsService implements CommentsService {
|
||||
return this._commentsApi;
|
||||
}
|
||||
|
||||
constructor(private apiService: AlfrescoApiService, private peopleProcessService: PeopleProcessService) {}
|
||||
protected apiService = inject(AlfrescoApiService);
|
||||
protected peopleProcessService = inject(PeopleProcessService);
|
||||
|
||||
/**
|
||||
* Gets all comments that have been added to a task.
|
@ -18,6 +18,6 @@
|
||||
import { TaskCommentsComponent } from './task-comments.component';
|
||||
|
||||
export * from './task-comments.component';
|
||||
export * from './task-comments.service';
|
||||
export * from '../services/task-comments.service';
|
||||
|
||||
export const TASK_COMMENTS_DIRECTIVES = [TaskCommentsComponent] as const;
|
||||
|
@ -17,7 +17,7 @@
|
||||
|
||||
import { Component, Input, ViewEncapsulation } from '@angular/core';
|
||||
import { ADF_COMMENTS_SERVICE, CommentsModule } from '@alfresco/adf-core';
|
||||
import { TaskCommentsService } from './task-comments.service';
|
||||
import { TaskCommentsService } from '../services/task-comments.service';
|
||||
import { CommonModule } from '@angular/common';
|
||||
|
||||
@Component({
|
||||
|
@ -20,7 +20,7 @@ import { of, throwError } from 'rxjs';
|
||||
import { TaskListService } from '../../services/tasklist.service';
|
||||
import { StartTaskComponent } from './start-task.component';
|
||||
import { ProcessTestingModule } from '../../../testing/process.testing.module';
|
||||
import { taskDetailsMock } from '../../../mock/task/task-details.mock';
|
||||
import { taskDetailsMock } from '../../../testing/mock/task/task-details.mock';
|
||||
import { HarnessLoader } from '@angular/cdk/testing';
|
||||
import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed';
|
||||
import { MatButtonHarness } from '@angular/material/button/testing';
|
||||
|
@ -20,14 +20,14 @@ import { ComponentFixture, fakeAsync, TestBed } from '@angular/core/testing';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { of, throwError } from 'rxjs';
|
||||
import { FormModel, FormOutcomeEvent, FormOutcomeModel, CommentModel, User } from '@alfresco/adf-core';
|
||||
import { noDataMock, taskDetailsMock, taskFormMock, tasksMock, taskDetailsWithOutAssigneeMock } from '../../../mock';
|
||||
import { noDataMock, taskDetailsMock, taskFormMock, tasksMock, taskDetailsWithOutAssigneeMock } from '../../../testing/mock';
|
||||
import { TaskListService } from '../../services/tasklist.service';
|
||||
import { TaskDetailsComponent } from './task-details.component';
|
||||
import { ProcessTestingModule } from '../../../testing/process.testing.module';
|
||||
import { TaskService } from '../../../form/services/task.service';
|
||||
import { TaskFormService } from '../../../form/services/task-form.service';
|
||||
import { TaskCommentsService } from '../../../task-comments/task-comments.service';
|
||||
import { PeopleProcessService } from '../../../common/services/people-process.service';
|
||||
import { TaskCommentsService } from '../../../services/task-comments.service';
|
||||
import { PeopleProcessService } from '../../../services/people-process.service';
|
||||
import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed';
|
||||
import { HarnessLoader } from '@angular/cdk/testing';
|
||||
import { MatDialogHarness } from '@angular/material/dialog/testing';
|
||||
|
@ -43,7 +43,7 @@ import { Observable, Observer, of, Subject } from 'rxjs';
|
||||
import { TaskListService } from '../../services/tasklist.service';
|
||||
import { catchError, share, takeUntil } from 'rxjs/operators';
|
||||
import { TaskFormComponent } from '../task-form/task-form.component';
|
||||
import { PeopleProcessService } from '../../../common/services/people-process.service';
|
||||
import { PeopleProcessService } from '../../../services/people-process.service';
|
||||
import { LightUserRepresentation, TaskQueryRepresentation, TaskRepresentation } from '@alfresco/js-api';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
|
@ -40,12 +40,12 @@ import {
|
||||
taskDetailsWithOutCandidateGroup,
|
||||
taskDetailsWithOutFormMock,
|
||||
taskFormMock
|
||||
} from '../../../mock/task/task-details.mock';
|
||||
} from '../../../testing/mock/task/task-details.mock';
|
||||
import { ProcessTestingModule } from '../../../testing/process.testing.module';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { TaskFormService } from '../../../form/services/task-form.service';
|
||||
import { TaskService } from '../../../form/services/task.service';
|
||||
import { PeopleProcessService } from '../../../common/services/people-process.service';
|
||||
import { PeopleProcessService } from '../../../services/people-process.service';
|
||||
import { TaskRepresentation } from '@alfresco/js-api';
|
||||
|
||||
describe('TaskFormComponent', () => {
|
||||
|
@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { Component, OnInit, Input, Output, EventEmitter, SimpleChanges, ViewEncapsulation, OnChanges } from '@angular/core';
|
||||
import { Component, OnInit, Input, Output, EventEmitter, SimpleChanges, ViewEncapsulation, OnChanges, inject } from '@angular/core';
|
||||
import {
|
||||
FormModel,
|
||||
ContentLinkModel,
|
||||
@ -28,7 +28,7 @@ import {
|
||||
import { TaskListService } from '../../services/tasklist.service';
|
||||
import { TaskRepresentation, UserRepresentation } from '@alfresco/js-api';
|
||||
import { Observable } from 'rxjs';
|
||||
import { PeopleProcessService } from '../../../common';
|
||||
import { PeopleProcessService } from '../../../services/people-process.service';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { MatCardModule } from '@angular/material/card';
|
||||
import { MatButtonModule } from '@angular/material/button';
|
||||
@ -154,11 +154,9 @@ export class TaskFormComponent implements OnInit, OnChanges {
|
||||
loading: boolean = false;
|
||||
internalReadOnlyForm: boolean = false;
|
||||
|
||||
constructor(
|
||||
private taskListService: TaskListService,
|
||||
private peopleProcessService: PeopleProcessService,
|
||||
private translationService: TranslationService
|
||||
) {}
|
||||
private taskListService = inject(TaskListService);
|
||||
private peopleProcessService = inject(PeopleProcessService);
|
||||
private translationService = inject(TranslationService);
|
||||
|
||||
ngOnInit() {
|
||||
this.peopleProcessService.getCurrentUserInfo().subscribe((user) => {
|
||||
|
@ -26,11 +26,11 @@ import {
|
||||
claimedTaskDetailsMock,
|
||||
claimedByGroupMemberMock,
|
||||
taskDetailsWithOutCandidateGroup
|
||||
} from '../../../mock';
|
||||
} from '../../../testing/mock';
|
||||
import { TaskListService } from '../../services/tasklist.service';
|
||||
import { TaskHeaderComponent } from './task-header.component';
|
||||
import { ProcessTestingModule } from '../../../testing/process.testing.module';
|
||||
import { PeopleProcessService } from '../../../common/services/people-process.service';
|
||||
import { PeopleProcessService } from '../../../services/people-process.service';
|
||||
import { TaskRepresentation } from '@alfresco/js-api';
|
||||
|
||||
describe('TaskHeaderComponent', () => {
|
||||
|
@ -27,7 +27,7 @@ import {
|
||||
CardViewItemLengthValidator,
|
||||
CardViewModule
|
||||
} from '@alfresco/adf-core';
|
||||
import { PeopleProcessService } from '../../../common/services/people-process.service';
|
||||
import { PeopleProcessService } from '../../../services/people-process.service';
|
||||
import { TaskDescriptionValidator } from '../../validators/task-description.validator';
|
||||
import { TaskRepresentation } from '@alfresco/js-api';
|
||||
import { CommonModule } from '@angular/common';
|
||||
|
@ -22,7 +22,7 @@ import { AppConfigService, DataRowEvent, ObjectDataRow, DataCellEvent, ObjectDat
|
||||
import { TaskListService } from '../../services/tasklist.service';
|
||||
import { TaskListComponent } from './task-list.component';
|
||||
import { ProcessTestingModule } from '../../../testing/process.testing.module';
|
||||
import { fakeGlobalTask, fakeEmptyTask, paginatedTask, fakeColumnSchema, fakeCustomSchema } from '../../../mock';
|
||||
import { fakeGlobalTask, fakeEmptyTask, paginatedTask, fakeColumnSchema, fakeCustomSchema } from '../../../testing/mock';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
import { of, Subject } from 'rxjs';
|
||||
import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed';
|
||||
|
@ -15,8 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { AlfrescoApiService, AppConfigService } from '@alfresco/adf-core';
|
||||
import { DiscoveryApiService, UploadService } from '@alfresco/adf-content-services';
|
||||
import { UploadService } from '@alfresco/adf-content-services';
|
||||
import { ActivitiContentApi, RelatedContentRepresentation } from '@alfresco/js-api';
|
||||
import { Injectable } from '@angular/core';
|
||||
|
||||
@ -30,10 +29,6 @@ export class ProcessUploadService extends UploadService {
|
||||
return this._contentApi;
|
||||
}
|
||||
|
||||
constructor(protected apiService: AlfrescoApiService, appConfigService: AppConfigService, discoveryApiService: DiscoveryApiService) {
|
||||
super(apiService, appConfigService, discoveryApiService);
|
||||
}
|
||||
|
||||
getUploadPromise(file: any): Promise<RelatedContentRepresentation> {
|
||||
const opts = {
|
||||
isRelatedContent: true
|
||||
|
@ -25,7 +25,7 @@ import { UserFiltersApi, UserTaskFilterRepresentation } from '@alfresco/js-api';
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class TaskFilterService {
|
||||
private apiService = inject(AlfrescoApiService);
|
||||
protected apiService = inject(AlfrescoApiService);
|
||||
|
||||
private _userFiltersApi: UserFiltersApi;
|
||||
get userFiltersApi(): UserFiltersApi {
|
||||
|
@ -15,8 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { AlfrescoApiService, AppConfigService } from '@alfresco/adf-core';
|
||||
import { DiscoveryApiService, UploadService } from '@alfresco/adf-content-services';
|
||||
import { UploadService } from '@alfresco/adf-content-services';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { ActivitiContentApi, RelatedContentRepresentation } from '@alfresco/js-api';
|
||||
|
||||
@ -30,10 +29,6 @@ export class TaskUploadService extends UploadService {
|
||||
return this._contentApi;
|
||||
}
|
||||
|
||||
constructor(protected apiService: AlfrescoApiService, appConfigService: AppConfigService, discoveryApiService: DiscoveryApiService) {
|
||||
super(apiService, appConfigService, discoveryApiService);
|
||||
}
|
||||
|
||||
getUploadPromise(file: any): Promise<RelatedContentRepresentation> {
|
||||
const opts = {
|
||||
isRelatedContent: true
|
||||
|
@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
import { AlfrescoApiService } from '@alfresco/adf-core';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { inject, Injectable } from '@angular/core';
|
||||
import { Observable, from, of } from 'rxjs';
|
||||
import { map, catchError, flatMap, filter } from 'rxjs/operators';
|
||||
import { Form } from '../models/form.model';
|
||||
@ -36,6 +36,8 @@ import {
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class TaskListService {
|
||||
protected apiService = inject(AlfrescoApiService);
|
||||
|
||||
private _modelsApi: ModelsApi;
|
||||
get modelsApi(): ModelsApi {
|
||||
this._modelsApi = this._modelsApi ?? new ModelsApi(this.apiService.getInstance());
|
||||
@ -60,8 +62,6 @@ export class TaskListService {
|
||||
return this._checklistsApi;
|
||||
}
|
||||
|
||||
constructor(private apiService: AlfrescoApiService) {}
|
||||
|
||||
/**
|
||||
* Gets all the filters in the list that belong to a task.
|
||||
*
|
||||
|
@ -15,7 +15,6 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export * from './lib/common/index';
|
||||
export * from './lib/process-list/index';
|
||||
export * from './lib/task-list/index';
|
||||
export * from './lib/app-list/index';
|
||||
@ -27,3 +26,6 @@ export * from './lib/form/index';
|
||||
export * from './lib/task-comments/index';
|
||||
export * from './lib/process.module';
|
||||
export * from './lib/compat/types';
|
||||
export * from './lib/services/apps-process.service';
|
||||
export * from './lib/services/people-process.service';
|
||||
export * from './lib/services/task-comments.service';
|
||||
|
Loading…
x
Reference in New Issue
Block a user