mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
tree shaking support for services (#3906)
[ADF-3697] tree shaking support for services
This commit is contained in:
committed by
Eugenio Romano
parent
368f949fc4
commit
fee35c98df
@@ -19,7 +19,9 @@ import { Injectable } from '@angular/core';
|
||||
import { MinimalNodeEntryEntity } from 'alfresco-js-api';
|
||||
import { CardViewDateItemModel, CardViewTextItemModel, FileSizePipe } from '@alfresco/adf-core';
|
||||
|
||||
@Injectable()
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class BasicPropertiesService {
|
||||
|
||||
constructor(private fileSizePipe: FileSizePipe) {
|
||||
|
@@ -28,7 +28,9 @@ import {
|
||||
LayoutOrientedConfig
|
||||
} from '../../interfaces/content-metadata.interfaces';
|
||||
|
||||
@Injectable()
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class ContentMetadataConfigFactory {
|
||||
|
||||
static readonly INDIFFERENT_PRESET = '*';
|
||||
|
@@ -26,7 +26,9 @@ import { ContentMetadataConfigFactory } from './config/content-metadata-config.f
|
||||
import { PropertyDescriptorsService } from './property-descriptors.service';
|
||||
import { map } from 'rxjs/operators';
|
||||
|
||||
@Injectable()
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class ContentMetadataService {
|
||||
|
||||
constructor(private basicPropertiesService: BasicPropertiesService,
|
||||
|
@@ -21,7 +21,9 @@ import { Observable, defer, forkJoin } from 'rxjs';
|
||||
import { PropertyGroup, PropertyGroupContainer } from '../interfaces/content-metadata.interfaces';
|
||||
import { map } from 'rxjs/operators';
|
||||
|
||||
@Injectable()
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class PropertyDescriptorsService {
|
||||
|
||||
constructor(private alfrescoApiService: AlfrescoApiService) {}
|
||||
|
@@ -39,7 +39,9 @@ const D_FLOAT = 'd:float';
|
||||
const D_DOUBLE = 'd:double';
|
||||
const D_BOOLEAN = 'd:boolean';
|
||||
|
||||
@Injectable()
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class PropertyGroupTranslatorService {
|
||||
|
||||
static readonly RECOGNISED_ECM_TYPES = [ D_TEXT, D_MLTEXT, D_DATE, D_DATETIME, D_INT, D_LONG , D_FLOAT, D_DOUBLE, D_BOOLEAN ];
|
||||
|
@@ -28,7 +28,9 @@ import { ContentNodeSelectorComponentData } from './content-node-selector.compon
|
||||
import { NodeLockDialogComponent } from '../dialogs/node-lock.dialog';
|
||||
import { switchMap } from 'rxjs/operators';
|
||||
|
||||
@Injectable()
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class ContentNodeDialogService {
|
||||
|
||||
/** Emitted when an error occurs. */
|
||||
|
@@ -23,7 +23,9 @@ import { Observable } from 'rxjs';
|
||||
/**
|
||||
* Internal service used by ContentNodeSelector component.
|
||||
*/
|
||||
@Injectable()
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class ContentNodeSelectorService {
|
||||
|
||||
constructor(private searchService: SearchService) {
|
||||
|
@@ -38,47 +38,6 @@ import { DialogModule } from './dialogs/dialog.module';
|
||||
import { FolderDirectiveModule } from './folder-directive/folder-directive.module';
|
||||
import { ContentMetadataModule } from './content-metadata/content-metadata.module';
|
||||
import { PermissionManagerModule } from './permission-manager/permission-manager.module';
|
||||
import { RatingService } from './social/services/rating.service';
|
||||
import { ContentMetadataService } from './content-metadata/services/content-metadata.service';
|
||||
import { PropertyDescriptorsService } from './content-metadata/services/property-descriptors.service';
|
||||
import { ContentMetadataConfigFactory } from './content-metadata/services/config/content-metadata-config.factory';
|
||||
import { BasicPropertiesService } from './content-metadata/services/basic-properties.service';
|
||||
import { PropertyGroupTranslatorService } from './content-metadata/services/property-groups-translator.service';
|
||||
import { SearchQueryBuilderService } from './search/search-query-builder.service';
|
||||
import { SearchFilterService } from './search/components/search-filter/search-filter.service';
|
||||
import { ContentNodeSelectorService } from './content-node-selector/content-node-selector.service';
|
||||
import { ContentNodeDialogService } from './content-node-selector/content-node-dialog.service';
|
||||
import { DocumentListService } from './document-list/services/document-list.service';
|
||||
import { FolderActionsService } from './document-list/services/folder-actions.service';
|
||||
import { DocumentActionsService } from './document-list/services/document-actions.service';
|
||||
import { NodeActionsService } from './document-list/services/node-actions.service';
|
||||
import { CustomResourcesService } from './document-list/services/custom-resources.service';
|
||||
import { NodePermissionDialogService } from './permission-manager/services/node-permission-dialog.service';
|
||||
import { NodePermissionService } from './permission-manager/services/node-permission.service';
|
||||
import { TagService } from './tag/services/tag.service';
|
||||
|
||||
export function providers() {
|
||||
return [
|
||||
RatingService,
|
||||
ContentMetadataService,
|
||||
PropertyDescriptorsService,
|
||||
ContentMetadataConfigFactory,
|
||||
BasicPropertiesService,
|
||||
PropertyGroupTranslatorService,
|
||||
SearchQueryBuilderService,
|
||||
SearchFilterService,
|
||||
ContentNodeSelectorService,
|
||||
ContentNodeDialogService,
|
||||
DocumentListService,
|
||||
FolderActionsService,
|
||||
DocumentActionsService,
|
||||
NodeActionsService,
|
||||
CustomResourcesService,
|
||||
NodePermissionDialogService,
|
||||
NodePermissionService,
|
||||
TagService
|
||||
];
|
||||
}
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
@@ -150,7 +109,6 @@ export class ContentModuleLazy {}
|
||||
VersionManagerModule
|
||||
],
|
||||
providers: [
|
||||
...providers(),
|
||||
{
|
||||
provide: TRANSLATION_PROVIDER,
|
||||
multi: true,
|
||||
@@ -184,7 +142,6 @@ export class ContentModule {
|
||||
return {
|
||||
ngModule: ContentModule,
|
||||
providers: [
|
||||
...providers(),
|
||||
{
|
||||
provide: TRANSLATION_PROVIDER,
|
||||
multi: true,
|
||||
|
@@ -32,7 +32,9 @@ import { Injectable } from '@angular/core';
|
||||
import { Observable, from, of, throwError } from 'rxjs';
|
||||
import { catchError, map } from 'rxjs/operators';
|
||||
|
||||
@Injectable()
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class CustomResourcesService {
|
||||
|
||||
private CREATE_PERMISSION = 'create';
|
||||
|
@@ -25,7 +25,9 @@ import { DocumentListService } from './document-list.service';
|
||||
import { NodeActionsService } from './node-actions.service';
|
||||
import { ContentNodeDialogService } from '../../content-node-selector/content-node-dialog.service';
|
||||
|
||||
@Injectable()
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class DocumentActionsService {
|
||||
|
||||
permissionEvent: Subject<PermissionModel> = new Subject<PermissionModel>();
|
||||
|
@@ -25,7 +25,9 @@ import { MinimalNodeEntity, MinimalNodeEntryEntity, NodeEntry, NodePaging } fro
|
||||
import { Observable, from, throwError } from 'rxjs';
|
||||
import { catchError } from 'rxjs/operators';
|
||||
|
||||
@Injectable()
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class DocumentListService {
|
||||
|
||||
static ROOT_ID = '-root-';
|
||||
|
@@ -24,7 +24,9 @@ import { PermissionModel } from '../models/permissions.model';
|
||||
import { DocumentListService } from './document-list.service';
|
||||
import { NodeActionsService } from './node-actions.service';
|
||||
|
||||
@Injectable()
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class FolderActionsService {
|
||||
|
||||
permissionEvent: Subject<PermissionModel> = new Subject<PermissionModel>();
|
||||
|
@@ -25,7 +25,9 @@ import { DocumentListService } from './document-list.service';
|
||||
import { ContentNodeDialogService } from '../../content-node-selector/content-node-dialog.service';
|
||||
import { NodeDownloadDirective } from '../../directives/node-download.directive';
|
||||
|
||||
@Injectable()
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class NodeActionsService {
|
||||
|
||||
@Output()
|
||||
|
@@ -25,7 +25,9 @@ import { NodePermissionService } from './node-permission.service';
|
||||
import { ContentService, PermissionsEnum } from '@alfresco/adf-core';
|
||||
import { switchMap } from 'rxjs/operators';
|
||||
|
||||
@Injectable()
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class NodePermissionDialogService {
|
||||
|
||||
constructor(private dialog: MatDialog,
|
||||
|
@@ -21,7 +21,9 @@ import { AlfrescoApiService, SearchService, NodesApiService, TranslationService
|
||||
import { QueryBody, MinimalNodeEntryEntity, MinimalNodeEntity, PathElement, GroupMemberEntry, GroupsPaging, GroupMemberPaging, PermissionElement } from 'alfresco-js-api';
|
||||
import { switchMap, map } from 'rxjs/operators';
|
||||
|
||||
@Injectable()
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class NodePermissionService {
|
||||
|
||||
constructor(private apiService: AlfrescoApiService,
|
||||
|
@@ -23,7 +23,9 @@ import { SearchNumberRangeComponent } from '../search-number-range/search-number
|
||||
import { SearchCheckListComponent } from '../search-check-list/search-check-list.component';
|
||||
import { SearchDateRangeComponent } from '../search-date-range/search-date-range.component';
|
||||
|
||||
@Injectable()
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class SearchFilterService {
|
||||
|
||||
/**
|
||||
|
@@ -28,7 +28,9 @@ import { SearchSortingDefinition } from './search-sorting-definition.interface';
|
||||
import { FacetField } from './facet-field.interface';
|
||||
import { FacetFieldBucket } from './facet-field-bucket.interface';
|
||||
|
||||
@Injectable()
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class SearchQueryBuilderService {
|
||||
|
||||
private _userQuery = '';
|
||||
|
@@ -22,7 +22,9 @@ import { RatingBody } from 'alfresco-js-api';
|
||||
import { from, throwError } from 'rxjs';
|
||||
import { catchError } from 'rxjs/operators';
|
||||
|
||||
@Injectable()
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class RatingService {
|
||||
|
||||
constructor(private apiService: AlfrescoApiService) {
|
||||
|
@@ -21,7 +21,9 @@ import { Observable, from, throwError } from 'rxjs';
|
||||
import { catchError } from 'rxjs/operators';
|
||||
import { TagPaging } from 'alfresco-js-api';
|
||||
|
||||
@Injectable()
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class TagService {
|
||||
|
||||
/** Emitted when tag information is updated. */
|
||||
|
Reference in New Issue
Block a user