mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[AAE-20109] Move alfresco js-API and alfrescoapi service out from the core (#9317)
* AAE-20109 Remove alfrescoapiservice from core * fix after rebase * [AAe-12502] Post-rebase fix * [AAE-12502] Add unit test fix --------- Co-authored-by: Bartosz Sekula <Bartosz.Sekula@hyland.com> Co-authored-by: MichalKinas <michal.kinas@hyland.com>
This commit is contained in:
@@ -18,8 +18,8 @@
|
||||
import { SimpleChange } from '@angular/core';
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { CreateProcessAttachmentComponent } from './create-process-attachment.component';
|
||||
import { AlfrescoApiService, AlfrescoApiServiceMock } from '@alfresco/adf-core';
|
||||
import { ProcessTestingModule } from '../../testing/process.testing.module';
|
||||
import { AlfrescoApiService, AlfrescoApiServiceMock } from '@alfresco/adf-content-services';
|
||||
|
||||
declare let jasmine: any;
|
||||
|
||||
|
@@ -15,8 +15,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { AlfrescoApiService, ExternalContent } from '@alfresco/adf-core';
|
||||
import { SitesService } from '@alfresco/adf-content-services';
|
||||
import { AlfrescoApiService, SitesService } from '@alfresco/adf-content-services';
|
||||
import { ExternalContent } from '@alfresco/adf-core';
|
||||
import { Injectable } from '@angular/core';
|
||||
import {
|
||||
IntegrationAlfrescoOnPremiseApi,
|
||||
|
@@ -19,6 +19,7 @@ import { Observable } from 'rxjs';
|
||||
import { FormModel, CoreTestingModule } from '@alfresco/adf-core';
|
||||
import { EcmModelService } from './ecm-model.service';
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
import { AlfrescoApiService, AlfrescoApiServiceMock } from '@alfresco/adf-content-services';
|
||||
|
||||
declare let jasmine: any;
|
||||
|
||||
@@ -27,7 +28,8 @@ describe('EcmModelService', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [CoreTestingModule]
|
||||
imports: [CoreTestingModule],
|
||||
providers: [{ provide: AlfrescoApiService, useClass: AlfrescoApiServiceMock }]
|
||||
});
|
||||
service = TestBed.inject(EcmModelService);
|
||||
jasmine.Ajax.install();
|
||||
|
@@ -15,7 +15,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { AlfrescoApiService, FormModel } from '@alfresco/adf-core';
|
||||
import { AlfrescoApiService } from '@alfresco/adf-content-services';
|
||||
import { FormModel } from '@alfresco/adf-core';
|
||||
import { EventEmitter, Injectable } from '@angular/core';
|
||||
import { Observable, from } from 'rxjs';
|
||||
import { map, catchError } from 'rxjs/operators';
|
||||
|
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { AlfrescoApiService } from '@alfresco/adf-core';
|
||||
import { AlfrescoApiService } from '@alfresco/adf-content-services';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Observable, from, throwError } from 'rxjs';
|
||||
import { FormModelsApi, FormRepresentation } from '@alfresco/js-api';
|
||||
|
@@ -17,7 +17,7 @@
|
||||
|
||||
import { Injectable } from '@angular/core';
|
||||
import { AlfrescoApi } from '@alfresco/js-api';
|
||||
import { AlfrescoApiService } from '@alfresco/adf-core';
|
||||
import { AlfrescoApiService } from '@alfresco/adf-content-services';
|
||||
|
||||
@Injectable({ providedIn: 'root' })
|
||||
export class ExternalAlfrescoApiService extends AlfrescoApiService {
|
||||
|
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { AlfrescoApiService } from '@alfresco/adf-core';
|
||||
import { AlfrescoApiService } from '@alfresco/adf-content-services';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Observable, from, throwError } from 'rxjs';
|
||||
import { ModelsApi } from '@alfresco/js-api';
|
||||
|
@@ -19,6 +19,7 @@ import { TestBed } from '@angular/core/testing';
|
||||
import { of } from 'rxjs';
|
||||
import { ProcessContentService } from './process-content.service';
|
||||
import { CoreTestingModule } from '@alfresco/adf-core';
|
||||
import { AlfrescoApiService, AlfrescoApiServiceMock } from '@alfresco/adf-content-services';
|
||||
|
||||
declare let jasmine: any;
|
||||
|
||||
@@ -66,7 +67,8 @@ describe('ProcessContentService', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [CoreTestingModule]
|
||||
imports: [CoreTestingModule],
|
||||
providers: [{ provide: AlfrescoApiService, useClass: AlfrescoApiServiceMock }]
|
||||
});
|
||||
service = TestBed.inject(ProcessContentService);
|
||||
});
|
||||
|
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { AlfrescoApiService } from '@alfresco/adf-core';
|
||||
import { AlfrescoApiService } from '@alfresco/adf-content-services';
|
||||
import { Injectable } from '@angular/core';
|
||||
import {
|
||||
ActivitiContentApi,
|
||||
|
@@ -15,7 +15,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { AlfrescoApiService, FormFieldOption } from '@alfresco/adf-core';
|
||||
import { AlfrescoApiService } from '@alfresco/adf-content-services';
|
||||
import { FormFieldOption } from '@alfresco/adf-core';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Observable, from, throwError } from 'rxjs';
|
||||
import { ProcessDefinitionsApi } from '@alfresco/js-api';
|
||||
|
@@ -15,7 +15,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { AlfrescoApiService, FormFieldOption, FormValues, TaskProcessVariableModel } from '@alfresco/adf-core';
|
||||
import { AlfrescoApiService } from '@alfresco/adf-content-services';
|
||||
import { FormFieldOption, FormValues, TaskProcessVariableModel } from '@alfresco/adf-core';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { from, Observable, throwError } from 'rxjs';
|
||||
import { CompleteFormRepresentation, SaveFormRepresentation, TaskFormsApi } from '@alfresco/js-api';
|
||||
|
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { AlfrescoApiService } from '@alfresco/adf-core';
|
||||
import { AlfrescoApiService } from '@alfresco/adf-content-services';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Observable, from, throwError } from 'rxjs';
|
||||
import { TaskRepresentation, TasksApi } from '@alfresco/js-api';
|
||||
|
@@ -17,11 +17,11 @@
|
||||
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
|
||||
import { ContentModule, ContentNodeSelectorPanelComponent, DocumentListService, SitesService, NodesApiService } from '@alfresco/adf-content-services';
|
||||
import { AlfrescoApiService, ContentModule, ContentNodeSelectorPanelComponent, DocumentListService, SitesService, NodesApiService } from '@alfresco/adf-content-services';
|
||||
import { EventEmitter, NO_ERRORS_SCHEMA } from '@angular/core';
|
||||
import { ProcessTestingModule } from '../../../testing/process.testing.module';
|
||||
import { AttachFileWidgetDialogComponent } from './attach-file-widget-dialog.component';
|
||||
import { AlfrescoApiService, BasicAlfrescoAuthService, OidcAuthenticationService } from '@alfresco/adf-core';
|
||||
import { BasicAlfrescoAuthService, OidcAuthenticationService } from '@alfresco/adf-core';
|
||||
import { AttachFileWidgetDialogComponentData } from './attach-file-widget-dialog-component.interface';
|
||||
import { of, throwError } from 'rxjs';
|
||||
import { By } from '@angular/platform-browser';
|
||||
|
@@ -17,9 +17,9 @@
|
||||
|
||||
import { Component, Inject, ViewEncapsulation, ViewChild } from '@angular/core';
|
||||
import { MAT_DIALOG_DATA, MatDialogModule, MatDialogRef } from '@angular/material/dialog';
|
||||
import { AlfrescoApiService, LoginDialogPanelComponent, TranslationService, AuthenticationService } from '@alfresco/adf-core';
|
||||
import { LoginDialogPanelComponent, TranslationService, AuthenticationService } from '@alfresco/adf-core';
|
||||
import { AttachFileWidgetDialogComponentData } from './attach-file-widget-dialog-component.interface';
|
||||
import { DocumentListService, SitesService, SearchService, ContentNodeSelectorPanelComponent } from '@alfresco/adf-content-services';
|
||||
import { DocumentListService, SitesService, SearchService, ContentNodeSelectorPanelComponent, AlfrescoApiService } from '@alfresco/adf-content-services';
|
||||
import { ExternalAlfrescoApiService } from '../../services/external-alfresco-api.service';
|
||||
import { Node } from '@alfresco/js-api';
|
||||
import { CommonModule } from '@angular/common';
|
||||
|
@@ -15,9 +15,10 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { AlfrescoApiService } from '@alfresco/adf-content-services';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
import { EventEmitter, Injectable, Output } from '@angular/core';
|
||||
import { AlfrescoApiService, TranslationService } from '@alfresco/adf-core';
|
||||
import { TranslationService } from '@alfresco/adf-core';
|
||||
import { Observable, of, Subject } from 'rxjs';
|
||||
import { AttachFileWidgetDialogComponentData } from './attach-file-widget-dialog-component.interface';
|
||||
import { AlfrescoEndpointRepresentation, Node, ContentApi } from '@alfresco/js-api';
|
||||
|
@@ -173,6 +173,7 @@ describe('AttachFileWidgetComponent', () => {
|
||||
});
|
||||
|
||||
it('should add file to tempFilesList when form has value and file source is configured', () => {
|
||||
spyOn(activitiContentService, 'getAlfrescoRepositories').and.returnValue(of(fakeRepositoryListAnswer));
|
||||
spyOn(widget, 'isFileSourceConfigured').and.returnValue(true);
|
||||
widget.field = new FormFieldModel(new FormModel(), {
|
||||
type: FormFieldTypes.UPLOAD,
|
||||
|
@@ -22,6 +22,7 @@ import { ContentLinkModel, CoreTestingModule, DownloadService } from '@alfresco/
|
||||
import { of } from 'rxjs';
|
||||
import { ContentWidgetComponent } from './content.widget';
|
||||
import { ProcessContentService } from '../../services/process-content.service';
|
||||
import { AlfrescoApiService, AlfrescoApiServiceMock } from '@alfresco/adf-content-services';
|
||||
|
||||
declare let jasmine: any;
|
||||
|
||||
@@ -59,7 +60,8 @@ describe('ContentWidgetComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [CoreTestingModule, ContentWidgetComponent]
|
||||
imports: [CoreTestingModule, ContentWidgetComponent],
|
||||
providers: [{ provide: AlfrescoApiService, useClass: AlfrescoApiServiceMock }]
|
||||
});
|
||||
downloadService = TestBed.inject(DownloadService);
|
||||
processContentService = TestBed.inject(ProcessContentService);
|
||||
|
@@ -24,10 +24,8 @@ import {
|
||||
FormFieldOption,
|
||||
FormFieldModel,
|
||||
FormModel,
|
||||
AlfrescoApiServiceMock,
|
||||
AppConfigServiceMock,
|
||||
AppConfigService,
|
||||
AlfrescoApiService,
|
||||
NoopTranslateModule
|
||||
} from '@alfresco/adf-core';
|
||||
import { RadioButtonsWidgetComponent } from './radio-buttons.widget';
|
||||
@@ -36,6 +34,7 @@ import { ProcessDefinitionService } from '../../services/process-definition.serv
|
||||
import { HarnessLoader } from '@angular/cdk/testing';
|
||||
import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed';
|
||||
import { MatRadioButtonHarness, MatRadioGroupHarness } from '@angular/material/radio/testing';
|
||||
import { AlfrescoApiService, AlfrescoApiServiceMock } from '@alfresco/adf-content-services';
|
||||
|
||||
describe('RadioButtonsWidgetComponent', () => {
|
||||
let formService: FormService;
|
||||
|
@@ -15,9 +15,10 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { AlfrescoApiService } from '@alfresco/adf-content-services';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Observable, from } from 'rxjs';
|
||||
import { CommentModel, AlfrescoApiService, CommentsService, User } from '@alfresco/adf-core';
|
||||
import { CommentModel, CommentsService, User } from '@alfresco/adf-core';
|
||||
import { map } from 'rxjs/operators';
|
||||
import { ActivitiCommentsApi } from '@alfresco/js-api';
|
||||
import { PeopleProcessService } from '../../services/people-process.service';
|
||||
|
@@ -20,6 +20,7 @@ import { ProcessFilterService } from './process-filter.service';
|
||||
import { CoreTestingModule } from '@alfresco/adf-core';
|
||||
import { ProcessInstanceFilterRepresentation, UserProcessInstanceFilterRepresentation } from '@alfresco/js-api';
|
||||
import { of } from 'rxjs';
|
||||
import { AlfrescoApiService, AlfrescoApiServiceMock } from '@alfresco/adf-content-services';
|
||||
|
||||
declare let jasmine: any;
|
||||
|
||||
@@ -49,7 +50,8 @@ describe('Process filter', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [CoreTestingModule]
|
||||
imports: [CoreTestingModule],
|
||||
providers: [{ provide: AlfrescoApiService, useClass: AlfrescoApiServiceMock }]
|
||||
});
|
||||
service = TestBed.inject(ProcessFilterService);
|
||||
});
|
||||
|
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { AlfrescoApiService } from '@alfresco/adf-core';
|
||||
import { AlfrescoApiService } from '@alfresco/adf-content-services';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Observable, from, forkJoin } from 'rxjs';
|
||||
import { map } from 'rxjs/operators';
|
||||
|
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { AlfrescoApiService, DateFnsUtils, FormValues } from '@alfresco/adf-core';
|
||||
import { DateFnsUtils, FormValues } from '@alfresco/adf-core';
|
||||
import { inject, Injectable } from '@angular/core';
|
||||
import {
|
||||
FormDefinitionRepresentation,
|
||||
@@ -31,6 +31,7 @@ import {
|
||||
ProcessDefinitionRepresentation,
|
||||
TaskRepresentation
|
||||
} from '@alfresco/js-api';
|
||||
import { AlfrescoApiService } from '@alfresco/adf-content-services';
|
||||
import { from, Observable } from 'rxjs';
|
||||
import { map } from 'rxjs/operators';
|
||||
import { DatePipe } from '@angular/common';
|
||||
|
@@ -18,7 +18,7 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { RuntimeAppDefinitionsApi, AppDefinitionRepresentation } from '@alfresco/js-api';
|
||||
import { Observable, from } from 'rxjs';
|
||||
import { AlfrescoApiService } from '@alfresco/adf-core';
|
||||
import { AlfrescoApiService } from '@alfresco/adf-content-services';
|
||||
import { map } from 'rxjs/operators';
|
||||
|
||||
@Injectable({
|
||||
|
@@ -19,6 +19,7 @@ import { fakeAsync, TestBed } from '@angular/core/testing';
|
||||
import { PeopleProcessService } from './people-process.service';
|
||||
import { CoreTestingModule } from '@alfresco/adf-core';
|
||||
import { LightUserRepresentation } from '@alfresco/js-api';
|
||||
import { AlfrescoApiService, AlfrescoApiServiceMock } from '@alfresco/adf-content-services';
|
||||
|
||||
declare let jasmine: any;
|
||||
|
||||
@@ -45,7 +46,8 @@ describe('PeopleProcessService', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [CoreTestingModule]
|
||||
imports: [CoreTestingModule],
|
||||
providers: [{ provide: AlfrescoApiService, useClass: AlfrescoApiServiceMock }]
|
||||
});
|
||||
service = TestBed.inject(PeopleProcessService);
|
||||
});
|
||||
|
@@ -17,8 +17,9 @@
|
||||
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Observable, from } from 'rxjs';
|
||||
import { AlfrescoApiService, GroupModel } from '@alfresco/adf-core';
|
||||
import { GroupModel } from '@alfresco/adf-core';
|
||||
import { map } from 'rxjs/operators';
|
||||
import { AlfrescoApiService } from '@alfresco/adf-content-services';
|
||||
import { TaskActionsApi, UsersApi, ActivitiGroupsApi, UserProfileApi, UserRepresentation, LightUserRepresentation } from '@alfresco/js-api';
|
||||
|
||||
@Injectable({
|
||||
|
@@ -15,7 +15,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { AlfrescoApiService, CommentModel, CommentsService } from '@alfresco/adf-core';
|
||||
import { AlfrescoApiService } from '@alfresco/adf-content-services';
|
||||
import { CommentModel, CommentsService } from '@alfresco/adf-core';
|
||||
import { ActivitiCommentsApi } from '@alfresco/js-api';
|
||||
import { inject, Injectable } from '@angular/core';
|
||||
import { from, Observable } from 'rxjs';
|
||||
|
@@ -25,8 +25,6 @@ import {
|
||||
DataCellEvent,
|
||||
ObjectDataColumn,
|
||||
AppConfigServiceMock,
|
||||
AlfrescoApiServiceMock,
|
||||
AlfrescoApiService,
|
||||
DataColumnComponent,
|
||||
DataColumnListComponent,
|
||||
FullNamePipe,
|
||||
@@ -44,6 +42,7 @@ import { HarnessLoader } from '@angular/cdk/testing';
|
||||
import { MatCheckboxHarness } from '@angular/material/checkbox/testing';
|
||||
import { MatMenuItemHarness } from '@angular/material/menu/testing';
|
||||
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
||||
import { AlfrescoApiService, AlfrescoApiServiceMock } from '@alfresco/adf-content-services';
|
||||
import { CommonModule } from '@angular/common';
|
||||
|
||||
declare let jasmine: any;
|
||||
|
@@ -15,11 +15,11 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { AlfrescoApiService } from '@alfresco/adf-core';
|
||||
import { inject, Injectable } from '@angular/core';
|
||||
import { Observable, forkJoin, from } from 'rxjs';
|
||||
import { map } from 'rxjs/operators';
|
||||
import { UserFiltersApi, UserTaskFilterRepresentation } from '@alfresco/js-api';
|
||||
import { AlfrescoApiService } from '@alfresco/adf-content-services';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
|
@@ -15,7 +15,6 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { AlfrescoApiService } from '@alfresco/adf-core';
|
||||
import { inject, Injectable } from '@angular/core';
|
||||
import { Observable, from, of } from 'rxjs';
|
||||
import { map, catchError, flatMap, filter } from 'rxjs/operators';
|
||||
@@ -31,6 +30,7 @@ import {
|
||||
UserTaskFilterRepresentation,
|
||||
TaskRepresentation
|
||||
} from '@alfresco/js-api';
|
||||
import { AlfrescoApiService } from '@alfresco/adf-content-services';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
|
@@ -15,12 +15,11 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { AlfrescoApiService, AlfrescoApiServiceMock } from '@alfresco/adf-content-services';
|
||||
import { NgModule } from '@angular/core';
|
||||
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
||||
import { ProcessModule } from '../process.module';
|
||||
import {
|
||||
AlfrescoApiService,
|
||||
AlfrescoApiServiceMock,
|
||||
AppConfigService,
|
||||
AppConfigServiceMock,
|
||||
CoreModule,
|
||||
|
Reference in New Issue
Block a user