Pre-Angular upgrade fixes (#5709)

* code fixes

* code fixes

* more code fixes

* even more fixes

* add missing typescript for cli

* rollback info drawer test changes

* use npx for cli commands

* restore attach providers
This commit is contained in:
Denys Vuika
2020-05-18 14:02:15 +01:00
committed by GitHub
parent 1def8000f0
commit 347e64fd91
150 changed files with 645 additions and 461 deletions

View File

@@ -15,6 +15,7 @@
* limitations under the License.
*/
export * from './components/content-metadata/content-metadata.component';
export * from './components/content-metadata-card/content-metadata-card.component';
export * from './services/basic-properties.service';
export * from './services/content-metadata.service';

View File

@@ -37,19 +37,14 @@ describe('PropertyGroupTranslatorService', () => {
let propertyGroup: OrganisedPropertyGroup;
let property: Property;
let propertyValues: { [key: string]: any };
let logService: LogService;
setupTestBed({
imports: [ContentTestingModule],
providers: [
{
provide: LogService, useValue: {
error: () => {}
}
}
]
imports: [ContentTestingModule]
});
beforeEach(() => {
logService = TestBed.get(LogService);
service = TestBed.get(PropertyGroupTranslatorService);
property = {
@@ -135,7 +130,6 @@ describe('PropertyGroupTranslatorService', () => {
});
it('should log an error if unrecognised type is found', () => {
const logService = TestBed.get(LogService);
spyOn(logService, 'error').and.stub();
property.name = 'FAS:PLAGUE';

View File

@@ -16,3 +16,4 @@
*/
export * from './content-directive.module';
export * from './node-lock.directive';

View File

@@ -19,58 +19,16 @@ import { DataColumn, DataRow, DataSorting, ContentService, ThumbnailService, set
import { FileNode, FolderNode, SmartFolderNode, RuleFolderNode, LinkFolderNode } from './../../mock';
import { ShareDataRow } from './share-data-row.model';
import { ShareDataTableAdapter } from './share-datatable-adapter';
import { DomSanitizer } from '@angular/platform-browser';
import { MatIconRegistry } from '@angular/material';
import { ContentTestingModule } from '../../testing/content.testing.module';
import { TestBed } from '@angular/core/testing';
class FakeSanitizer extends DomSanitizer {
constructor() {
super();
}
sanitize(html) {
return html;
}
bypassSecurityTrustHtml(value: string): any {
return value;
}
bypassSecurityTrustStyle(): any {
return null;
}
bypassSecurityTrustScript(): any {
return null;
}
bypassSecurityTrustUrl(): any {
return null;
}
bypassSecurityTrustResourceUrl(): any {
return null;
}
}
describe('ShareDataTableAdapter', () => {
let thumbnailService: ThumbnailService;
let contentService: ContentService;
setupTestBed({
imports: [ContentTestingModule],
providers: [
{
provide: MatIconRegistry,
useValue: jasmine.createSpyObj(['addSvgIcon', 'addSvgIconInNamespace'])
},
{
provide: DomSanitizer, useClass: FakeSanitizer
}
]
imports: [ContentTestingModule]
});
beforeEach(() => {

View File

@@ -44,9 +44,6 @@ describe('NodeActionsService', () => {
DialogModule
],
providers: [
NodeActionsService,
DocumentListService,
ContentNodeDialogService,
{ provide: MatDialogRef, useValue: dialogRef }
]
});

View File

@@ -70,9 +70,6 @@ describe('FolderCreateDirective', () => {
TestComponent,
FolderDialogComponent,
FolderCreateDirective
],
providers: [
ContentService
]
});

View File

@@ -18,7 +18,7 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { AddPermissionPanelComponent } from './add-permission-panel.component';
import { By } from '@angular/platform-browser';
import { SearchService, setupTestBed, SearchConfigurationService } from '@alfresco/adf-core';
import { SearchService, setupTestBed } from '@alfresco/adf-core';
import { of } from 'rxjs';
import { fakeAuthorityListResult, fakeNameListResult } from '../../../mock/add-permission.component.mock';
import { ContentTestingModule } from '../../../testing/content.testing.module';
@@ -33,8 +33,7 @@ describe('AddPermissionPanelComponent', () => {
let debugElement: DebugElement;
setupTestBed({
imports: [ContentTestingModule],
providers: [SearchService, SearchConfigurationService]
imports: [ContentTestingModule]
});
beforeEach(() => {

View File

@@ -17,12 +17,11 @@
import { QueryBody } from '@alfresco/js-api';
import { SearchConfigurationInterface } from '@alfresco/adf-core';
import { Injectable } from '@angular/core';
@Injectable()
export class SearchPermissionConfigurationService implements SearchConfigurationInterface {
constructor() {
}
public generateQueryBody(searchTerm: string, maxResults: number, skipCount: number): QueryBody {
const defaultQueryBody: QueryBody = {
query: {

View File

@@ -23,7 +23,6 @@ import { of } from 'rxjs';
import { fakeEmptyResponse, fakeNodeWithOnlyLocally, fakeSiteRoles, fakeSiteNodeResponse,
fakeNodeToRemovePermission, fakeNodeWithoutPermissions } from '../../mock/permission-list.component.mock';
import { fakeAuthorityResults } from '../../mock/add-permission.component.mock';
import { NodePermissionDialogService } from './node-permission-dialog.service';
describe('NodePermissionService', () => {
@@ -34,10 +33,6 @@ describe('NodePermissionService', () => {
setupTestBed({
imports: [
CoreModule.forRoot()
],
providers: [
NodePermissionDialogService,
NodePermissionService
]
});

View File

@@ -15,23 +15,33 @@
* limitations under the License.
*/
export { FacetFieldBucket } from './facet-field-bucket.interface';
export { FacetField } from './facet-field.interface';
export { FacetQuery } from './facet-query.interface';
export { FilterQuery } from './filter-query.interface';
export { SearchCategory } from './search-category.interface';
export { SearchWidgetSettings } from './search-widget-settings.interface';
export { SearchWidget } from './search-widget.interface';
export { SearchConfiguration } from './search-configuration.interface';
export { SearchQueryBuilderService } from './search-query-builder.service';
export { SearchRange } from './search-range.interface';
export * from './facet-field-bucket.interface';
export * from './facet-field.interface';
export * from './facet-query.interface';
export * from './filter-query.interface';
export * from './search-category.interface';
export * from './search-widget-settings.interface';
export * from './search-widget.interface';
export * from './search-configuration.interface';
export * from './search-query-builder.service';
export * from './search-range.interface';
export * from './components/search.component';
export * from './components/search-control.component';
export * from './components/empty-search-result.component';
export * from './components/search-control.component';
export * from './components/search.component';
export * from './components/search-check-list/search-check-list.component';
export * from './components/search-chip-list/search-chip-list.component';
export * from './components/search-date-range/search-date-range.component';
export * from './components/search-filter/search-filter.component';
export * from './components/search-filter/search-filter.service';
export * from './components/search-number-range/search-number-range.component';
export * from './components/search-radio/search-radio.component';
export * from './components/search-slider/search-slider.component';
export * from './components/search-chip-list/search-chip-list.component';
export * from './components/search-sorting-picker/search-sorting-picker.component';
export * from './components/search-text/search-text.component';
export * from './components/search-widget-container/search-widget-container.component';
export * from './search.module';

View File

@@ -36,14 +36,6 @@ import { SearchCheckListComponent } from './components/search-check-list/search-
import { SearchDateRangeComponent } from './components/search-date-range/search-date-range.component';
import { SearchSortingPickerComponent } from './components/search-sorting-picker/search-sorting-picker.component';
export const ALFRESCO_SEARCH_DIRECTIVES: any[] = [
SearchComponent,
SearchControlComponent,
EmptySearchResultComponent,
SearchFilterComponent,
SearchChipListComponent
];
@NgModule({
imports: [
CommonModule,
@@ -53,7 +45,11 @@ export const ALFRESCO_SEARCH_DIRECTIVES: any[] = [
CoreModule
],
declarations: [
...ALFRESCO_SEARCH_DIRECTIVES,
SearchComponent,
SearchControlComponent,
EmptySearchResultComponent,
SearchFilterComponent,
SearchChipListComponent,
SearchWidgetContainerComponent,
SearchTextComponent,
SearchRadioComponent,
@@ -64,7 +60,11 @@ export const ALFRESCO_SEARCH_DIRECTIVES: any[] = [
SearchSortingPickerComponent
],
exports: [
...ALFRESCO_SEARCH_DIRECTIVES,
SearchComponent,
SearchControlComponent,
EmptySearchResultComponent,
SearchFilterComponent,
SearchChipListComponent,
SearchWidgetContainerComponent,
SearchTextComponent,
SearchRadioComponent,

View File

@@ -39,8 +39,7 @@ describe('FileUploadingDialogComponent', () => {
UploadModule
],
providers: [
{ provide: AlfrescoApiService, useClass: AlfrescoApiServiceMock },
UserPreferencesService
{ provide: AlfrescoApiService, useClass: AlfrescoApiServiceMock }
]
});

View File

@@ -59,8 +59,6 @@ describe('UploadButtonComponent', () => {
UploadButtonComponent
],
providers: [
UploadService,
ContentService,
{ provide: TranslationService, useClass: TranslationMock }
]
});

View File

@@ -27,7 +27,6 @@ import {
import { FileDraggableDirective } from '../directives/file-draggable.directive';
import { UploadDragAreaComponent } from './upload-drag-area.component';
import { throwError } from 'rxjs';
function getFakeShareDataRow(allowableOperations = ['delete', 'update', 'create']) {
return {
@@ -111,7 +110,6 @@ describe('UploadDragAreaComponent', () => {
UploadDragAreaComponent
],
providers: [
UploadService,
{ provide: AlfrescoApiService, useClass: AlfrescoApiServiceMock }
]
});
@@ -417,7 +415,6 @@ describe('UploadDragAreaComponent', () => {
};
fixture.detectChanges();
spyOn(uploadService, 'fileUploadError').and.returnValue(throwError(new Error()));
component.error.subscribe((error) => {
expect(error).not.toBeNull();