mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-06-30 18:15:11 +00:00
tree shaking support for services (#3906)
[ADF-3697] tree shaking support for services
This commit is contained in:
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. */
|
||||
|
@ -37,7 +37,9 @@ export enum AppConfigValues {
|
||||
DISABLECSRF = 'disableCSRF'
|
||||
}
|
||||
|
||||
@Injectable()
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class AppConfigService {
|
||||
|
||||
config: any = {
|
||||
|
@ -24,7 +24,9 @@ import { CardViewBoolItemComponent } from '../components/card-view-boolitem/card
|
||||
import { CardViewKeyValuePairsItemComponent } from '../components/card-view-keyvaluepairsitem/card-view-keyvaluepairsitem.component';
|
||||
import { DynamicComponentMapper, DynamicComponentResolveFunction, DynamicComponentResolver } from '../../services/dynamic-component-mapper.service';
|
||||
|
||||
@Injectable()
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class CardItemTypeService extends DynamicComponentMapper {
|
||||
|
||||
protected defaultValue: Type<{}> = CardViewTextItemComponent;
|
||||
|
@ -36,7 +36,9 @@ export function transformKeyToObject(key: string, value): Object {
|
||||
}, value);
|
||||
}
|
||||
|
||||
@Injectable()
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class CardViewUpdateService {
|
||||
|
||||
// Observable sources
|
||||
|
@ -29,7 +29,9 @@ const DEFAULT_CONFIG: ContextMenuOverlayConfig = {
|
||||
hasBackdrop: true
|
||||
};
|
||||
|
||||
@Injectable()
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class ContextMenuOverlayService {
|
||||
|
||||
constructor( private injector: Injector, private overlay: Overlay) { }
|
||||
|
@ -18,7 +18,9 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Subject } from 'rxjs';
|
||||
|
||||
@Injectable()
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class ContextMenuService {
|
||||
public show: Subject<{event: MouseEvent, obj: any[]}> = new Subject<{event: MouseEvent, obj: any[]}>();
|
||||
}
|
||||
|
@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { CommonModule, DatePipe } from '@angular/common';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { HttpClient, HttpClientModule } from '@angular/common/http';
|
||||
|
||||
import { APP_INITIALIZER, NgModule, ModuleWithProviders } from '@angular/core';
|
||||
@ -49,116 +49,16 @@ import { DirectiveModule } from './directives/directive.module';
|
||||
import { PipeModule } from './pipes/pipe.module';
|
||||
|
||||
import { AlfrescoApiService } from './services/alfresco-api.service';
|
||||
import { AppsProcessService } from './services/apps-process.service';
|
||||
import { AuthGuardBpm } from './services/auth-guard-bpm.service';
|
||||
import { AuthGuardEcm } from './services/auth-guard-ecm.service';
|
||||
import { AuthGuard } from './services/auth-guard.service';
|
||||
import { AuthenticationService } from './services/authentication.service';
|
||||
import { CardItemTypeService } from './card-view/services/card-item-types.service';
|
||||
import { CardViewUpdateService } from './card-view/services/card-view-update.service';
|
||||
import { CommentProcessService } from './services/comment-process.service';
|
||||
import { CommentContentService } from './services/comment-content.service';
|
||||
import { ContentService } from './services/content.service';
|
||||
import { CookieService } from './services/cookie.service';
|
||||
import { DeletedNodesApiService } from './services/deleted-nodes-api.service';
|
||||
import { DiscoveryApiService } from './services/discovery-api.service';
|
||||
import { FavoritesApiService } from './services/favorites-api.service';
|
||||
import { HighlightTransformService } from './services/highlight-transform.service';
|
||||
import { LogService } from './services/log.service';
|
||||
import { NodesApiService } from './services/nodes-api.service';
|
||||
import { NotificationService } from './services/notification.service';
|
||||
import { PageTitleService } from './services/page-title.service';
|
||||
import { PeopleContentService } from './services/people-content.service';
|
||||
import { PeopleProcessService } from './services/people-process.service';
|
||||
import { RenditionsService } from './services/renditions.service';
|
||||
import { SearchService } from './services/search.service';
|
||||
import { SettingsService } from './services/settings.service';
|
||||
import { SharedLinksApiService } from './services/shared-links-api.service';
|
||||
import { SitesService } from './services/sites.service';
|
||||
import { StorageService } from './services/storage.service';
|
||||
import { ThumbnailService } from './services/thumbnail.service';
|
||||
import { TranslateLoaderService } from './services/translate-loader.service';
|
||||
import { TranslationService } from './services/translation.service';
|
||||
import { UploadService } from './services/upload.service';
|
||||
import { UserPreferencesService } from './services/user-preferences.service';
|
||||
import { SearchConfigurationService } from './services/search-configuration.service';
|
||||
import { startupServiceFactory } from './services/startup-service-factory';
|
||||
import { SortingPickerModule } from './sorting-picker/sorting-picker.module';
|
||||
import { AppConfigService } from './app-config/app-config.service';
|
||||
import { ContextMenuService } from './context-menu/context-menu.service';
|
||||
import { ContextMenuOverlayService } from './context-menu/context-menu-overlay.service';
|
||||
import { ActivitiContentService } from './form/services/activiti-alfresco.service';
|
||||
import { EcmModelService } from './form/services/ecm-model.service';
|
||||
import { FormRenderingService } from './form/services/form-rendering.service';
|
||||
import { FormService } from './form/services/form.service';
|
||||
import { NodeService } from './form/services/node.service';
|
||||
import { ProcessContentService } from './form/services/process-content.service';
|
||||
import { WidgetVisibilityService } from './form/services/widget-visibility.service';
|
||||
import { EcmUserService } from './userinfo/services/ecm-user.service';
|
||||
import { BpmUserService } from './userinfo/services/bpm-user.service';
|
||||
import { ViewUtilService } from './viewer/services/view-util.service';
|
||||
import { LoginDialogService } from './services/login-dialog.service';
|
||||
import { ExternalAlfrescoApiService } from './services/external-alfresco-api.service';
|
||||
|
||||
export function createTranslateLoader(http: HttpClient) {
|
||||
return new TranslateLoaderService(http);
|
||||
}
|
||||
|
||||
export function providers() {
|
||||
return [
|
||||
AuthenticationService,
|
||||
AlfrescoApiService,
|
||||
SettingsService,
|
||||
ContentService,
|
||||
AuthGuard,
|
||||
AuthGuardEcm,
|
||||
AuthGuardBpm,
|
||||
AppsProcessService,
|
||||
PageTitleService,
|
||||
StorageService,
|
||||
CookieService,
|
||||
RenditionsService,
|
||||
NotificationService,
|
||||
LogService,
|
||||
TranslationService,
|
||||
TranslateLoaderService,
|
||||
ThumbnailService,
|
||||
UploadService,
|
||||
CardItemTypeService,
|
||||
CardViewUpdateService,
|
||||
UserPreferencesService,
|
||||
HighlightTransformService,
|
||||
DeletedNodesApiService,
|
||||
FavoritesApiService,
|
||||
NodesApiService,
|
||||
PeopleContentService,
|
||||
PeopleProcessService,
|
||||
SearchService,
|
||||
SharedLinksApiService,
|
||||
SitesService,
|
||||
DiscoveryApiService,
|
||||
CommentProcessService,
|
||||
CommentContentService,
|
||||
SearchConfigurationService,
|
||||
DatePipe,
|
||||
AppConfigService,
|
||||
ContextMenuService,
|
||||
ContextMenuOverlayService,
|
||||
ActivitiContentService,
|
||||
EcmModelService,
|
||||
FormRenderingService,
|
||||
FormService,
|
||||
NodeService,
|
||||
ProcessContentService,
|
||||
WidgetVisibilityService,
|
||||
EcmUserService,
|
||||
BpmUserService,
|
||||
ViewUtilService,
|
||||
LoginDialogService,
|
||||
ExternalAlfrescoApiService
|
||||
];
|
||||
}
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
AboutModule,
|
||||
@ -305,7 +205,6 @@ export class CoreModuleLazy {
|
||||
SortingPickerModule
|
||||
],
|
||||
providers: [
|
||||
...providers(),
|
||||
{
|
||||
provide: APP_INITIALIZER,
|
||||
useFactory: startupServiceFactory,
|
||||
@ -321,7 +220,6 @@ export class CoreModule {
|
||||
return {
|
||||
ngModule: CoreModule,
|
||||
providers: [
|
||||
...providers(),
|
||||
{
|
||||
provide: APP_INITIALIZER,
|
||||
useFactory: startupServiceFactory,
|
||||
|
@ -24,7 +24,9 @@ import { ExternalContent } from '../components/widgets/core/external-content';
|
||||
import { ExternalContentLink } from '../components/widgets/core/external-content-link';
|
||||
import { map, catchError } from 'rxjs/operators';
|
||||
|
||||
@Injectable()
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class ActivitiContentService {
|
||||
|
||||
static UNKNOWN_ERROR_MESSAGE: string = 'Unknown error';
|
||||
|
@ -22,7 +22,9 @@ import { Observable, from } from 'rxjs';
|
||||
import { FormModel } from '../components/widgets/core/form.model';
|
||||
import { map, catchError } from 'rxjs/operators';
|
||||
|
||||
@Injectable()
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class EcmModelService {
|
||||
|
||||
public static MODEL_NAMESPACE: string = 'activitiForms';
|
||||
|
@ -40,7 +40,9 @@ import {
|
||||
DateTimeWidgetComponent
|
||||
} from './../components/widgets/index';
|
||||
|
||||
@Injectable()
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class FormRenderingService extends DynamicComponentMapper {
|
||||
|
||||
protected defaultValue: Type<{}> = UnknownWidgetComponent;
|
||||
|
@ -31,7 +31,9 @@ import {
|
||||
import { EcmModelService } from './ecm-model.service';
|
||||
import { map, catchError, switchMap, combineAll, defaultIfEmpty } from 'rxjs/operators';
|
||||
|
||||
@Injectable()
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class FormService {
|
||||
|
||||
static UNKNOWN_ERROR_MESSAGE: string = 'Unknown error';
|
||||
|
@ -21,7 +21,9 @@ import { Observable, from } from 'rxjs';
|
||||
import { NodeMetadata } from '../models/node-metadata.model';
|
||||
import { map } from 'rxjs/operators';
|
||||
|
||||
@Injectable()
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class NodeService {
|
||||
|
||||
constructor(private apiService: AlfrescoApiService) {
|
||||
|
@ -22,7 +22,9 @@ import { RelatedContentRepresentation } from 'alfresco-js-api';
|
||||
import { Observable, from, throwError } from 'rxjs';
|
||||
import { catchError } from 'rxjs/operators';
|
||||
|
||||
@Injectable()
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class ProcessContentService {
|
||||
|
||||
static UNKNOWN_ERROR_MESSAGE: string = 'Unknown error';
|
||||
|
@ -25,7 +25,9 @@ import { TaskProcessVariableModel } from '../models/task-process-variable.model'
|
||||
import { WidgetVisibilityModel } from '../models/widget-visibility.model';
|
||||
import { map, catchError } from 'rxjs/operators';
|
||||
|
||||
@Injectable()
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class WidgetVisibilityService {
|
||||
|
||||
private processVarList: TaskProcessVariableModel[];
|
||||
|
@ -39,7 +39,9 @@ import { OauthConfigModel } from '../models/oauth-config.model';
|
||||
|
||||
/* tslint:disable:adf-file-name */
|
||||
|
||||
@Injectable()
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class AlfrescoApiService {
|
||||
/**
|
||||
* Publish/subscribe to events related to node updates.
|
||||
|
@ -22,7 +22,9 @@ import { AlfrescoApiService } from './alfresco-api.service';
|
||||
import { LogService } from './log.service';
|
||||
import { map, catchError } from 'rxjs/operators';
|
||||
|
||||
@Injectable()
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class AppsProcessService {
|
||||
|
||||
constructor(private apiService: AlfrescoApiService,
|
||||
|
@ -21,7 +21,9 @@ import { AppConfigService, AppConfigValues } from '../app-config/app-config.serv
|
||||
import { AuthenticationService } from './authentication.service';
|
||||
import { OauthConfigModel } from '../models/oauth-config.model';
|
||||
|
||||
@Injectable()
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class AuthGuardBpm implements CanActivate, CanActivateChild {
|
||||
constructor(private authService: AuthenticationService, private router: Router, private appConfig: AppConfigService) {}
|
||||
|
||||
|
@ -23,7 +23,9 @@ import { AuthenticationService } from './authentication.service';
|
||||
import { AppConfigService, AppConfigValues } from '../app-config/app-config.service';
|
||||
import { OauthConfigModel } from '../models/oauth-config.model';
|
||||
|
||||
@Injectable()
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class AuthGuardEcm implements CanActivate {
|
||||
constructor(private authService: AuthenticationService,
|
||||
private router: Router,
|
||||
|
@ -25,7 +25,9 @@ import { Observable } from 'rxjs';
|
||||
import { AppConfigService, AppConfigValues } from '../app-config/app-config.service';
|
||||
import { OauthConfigModel } from '../models/oauth-config.model';
|
||||
|
||||
@Injectable()
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class AuthGuard implements CanActivate, CanActivateChild {
|
||||
constructor(private authService: AuthenticationService,
|
||||
private router: Router,
|
||||
|
@ -29,7 +29,9 @@ import { HttpHeaders } from '@angular/common/http';
|
||||
const REMEMBER_ME_COOKIE_KEY = 'ALFRESCO_REMEMBER_ME';
|
||||
const REMEMBER_ME_UNTIL = 1000 * 60 * 60 * 24 * 30;
|
||||
|
||||
@Injectable()
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class AuthenticationService {
|
||||
private redirectUrl: RedirectionModel = null;
|
||||
|
||||
|
@ -22,7 +22,9 @@ import { AlfrescoApiService } from '../services/alfresco-api.service';
|
||||
import { LogService } from '../services/log.service';
|
||||
import { map, catchError } from 'rxjs/operators';
|
||||
|
||||
@Injectable()
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class CommentContentService {
|
||||
|
||||
constructor(private apiService: AlfrescoApiService,
|
||||
|
@ -23,7 +23,9 @@ import { AlfrescoApiService } from './alfresco-api.service';
|
||||
import { LogService } from './log.service';
|
||||
import { map, catchError } from 'rxjs/operators';
|
||||
|
||||
@Injectable()
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class CommentProcessService {
|
||||
|
||||
constructor(private apiService: AlfrescoApiService,
|
||||
|
@ -26,7 +26,9 @@ import { AuthenticationService } from './authentication.service';
|
||||
import { LogService } from './log.service';
|
||||
import { catchError, tap } from 'rxjs/operators';
|
||||
|
||||
@Injectable()
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class ContentService {
|
||||
|
||||
private saveData: Function;
|
||||
|
@ -17,7 +17,9 @@
|
||||
|
||||
import { Injectable } from '@angular/core';
|
||||
|
||||
@Injectable()
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class CookieService {
|
||||
|
||||
/**
|
||||
|
@ -23,7 +23,9 @@ import { AlfrescoApiService } from './alfresco-api.service';
|
||||
import { UserPreferencesService } from './user-preferences.service';
|
||||
import { catchError } from 'rxjs/operators';
|
||||
|
||||
@Injectable()
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class DeletedNodesApiService {
|
||||
constructor(
|
||||
private apiService: AlfrescoApiService,
|
||||
|
@ -22,7 +22,9 @@ import { AlfrescoApiService } from './alfresco-api.service';
|
||||
import { map, catchError } from 'rxjs/operators';
|
||||
import { Observable } from 'rxjs';
|
||||
|
||||
@Injectable()
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class DiscoveryApiService {
|
||||
|
||||
constructor(private apiService: AlfrescoApiService) { }
|
||||
|
@ -24,7 +24,9 @@ import {
|
||||
import * as alfrescoApi from 'alfresco-js-api';
|
||||
/* tslint:disable:adf-file-name */
|
||||
|
||||
@Injectable()
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class ExternalAlfrescoApiService {
|
||||
|
||||
protected alfrescoApi: AlfrescoApi;
|
||||
|
@ -22,7 +22,9 @@ import { AlfrescoApiService } from './alfresco-api.service';
|
||||
import { UserPreferencesService } from './user-preferences.service';
|
||||
import { catchError } from 'rxjs/operators';
|
||||
|
||||
@Injectable()
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class FavoritesApiService {
|
||||
|
||||
static remapEntry({ entry }: any): any {
|
||||
|
@ -15,11 +15,16 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { Injectable } from '@angular/core';
|
||||
|
||||
export interface HightlightTransformResult {
|
||||
text: string;
|
||||
changed: boolean;
|
||||
}
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class HighlightTransformService {
|
||||
|
||||
/**
|
||||
|
@ -22,7 +22,9 @@ import { AppConfigService, AppConfigValues } from '../app-config/app-config.serv
|
||||
import { logLevels, LogLevelsEnum } from '../models/log-levels.model';
|
||||
import { Subject } from 'rxjs';
|
||||
|
||||
@Injectable()
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class LogService {
|
||||
|
||||
get currentLogLevel() {
|
||||
|
@ -21,7 +21,9 @@ import { Subject, Observable } from 'rxjs';
|
||||
import { LoginDialogComponent } from '../login/components/login-dialog.component';
|
||||
import { LoginDialogComponentData } from '../login/components/login-dialog-component-data.interface';
|
||||
|
||||
@Injectable()
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class LoginDialogService {
|
||||
|
||||
constructor(private dialog: MatDialog) {
|
||||
|
@ -22,7 +22,9 @@ import { AlfrescoApiService } from './alfresco-api.service';
|
||||
import { UserPreferencesService } from './user-preferences.service';
|
||||
import { catchError } from 'rxjs/operators';
|
||||
|
||||
@Injectable()
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class NodesApiService {
|
||||
|
||||
constructor(
|
||||
|
@ -19,7 +19,9 @@ import { Injectable } from '@angular/core';
|
||||
import { MatSnackBar, MatSnackBarRef, MatSnackBarConfig } from '@angular/material';
|
||||
import { TranslationService } from './translation.service';
|
||||
|
||||
@Injectable()
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class NotificationService {
|
||||
|
||||
static DEFAULT_DURATION_MESSAGE: number = 5000;
|
||||
|
@ -20,7 +20,9 @@ import { Title } from '@angular/platform-browser';
|
||||
import { AppConfigService } from '../app-config/app-config.service';
|
||||
import { TranslationService } from './translation.service';
|
||||
|
||||
@Injectable()
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class PageTitleService {
|
||||
|
||||
private originalTitle: string = '';
|
||||
|
@ -20,7 +20,9 @@ import { Observable, from, of } from 'rxjs';
|
||||
import { AlfrescoApiService } from './alfresco-api.service';
|
||||
import { catchError } from 'rxjs/operators';
|
||||
|
||||
@Injectable()
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class PeopleContentService {
|
||||
|
||||
constructor(private apiService: AlfrescoApiService) {}
|
||||
|
@ -23,7 +23,9 @@ import { AlfrescoApiService } from './alfresco-api.service';
|
||||
import { LogService } from './log.service';
|
||||
import { catchError, map } from 'rxjs/operators';
|
||||
|
||||
@Injectable()
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class PeopleProcessService {
|
||||
|
||||
constructor(private alfrescoJsApi: AlfrescoApiService,
|
||||
|
@ -26,7 +26,9 @@ import { concatMap, switchMap, takeWhile } from 'rxjs/operators';
|
||||
* RenditionsService
|
||||
* (this service is deprecated in 2.2.0 and will be removed in future revisions)
|
||||
*/
|
||||
@Injectable()
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class RenditionsService {
|
||||
|
||||
constructor(private apiService: AlfrescoApiService) {
|
||||
|
@ -19,7 +19,9 @@ import { Injectable } from '@angular/core';
|
||||
import { QueryBody } from 'alfresco-js-api';
|
||||
import { SearchConfigurationInterface } from '../interface/search-configuration.interface';
|
||||
|
||||
@Injectable()
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class SearchConfigurationService implements SearchConfigurationInterface {
|
||||
|
||||
constructor() {
|
||||
|
@ -22,7 +22,9 @@ import { AlfrescoApiService } from './alfresco-api.service';
|
||||
import { SearchConfigurationService } from './search-configuration.service';
|
||||
import { catchError } from 'rxjs/operators';
|
||||
|
||||
@Injectable()
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class SearchService {
|
||||
|
||||
dataLoaded: Subject<NodePaging> = new Subject();
|
||||
|
@ -20,7 +20,9 @@ import { AppConfigService, AppConfigValues } from '../app-config/app-config.serv
|
||||
import { LogService } from './log.service';
|
||||
import { StorageService } from './storage.service';
|
||||
|
||||
@Injectable()
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class SettingsService {
|
||||
|
||||
constructor(private appConfig: AppConfigService,
|
||||
|
@ -22,7 +22,9 @@ import { AlfrescoApiService } from './alfresco-api.service';
|
||||
import { UserPreferencesService } from './user-preferences.service';
|
||||
import { catchError } from 'rxjs/operators';
|
||||
|
||||
@Injectable()
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class SharedLinksApiService {
|
||||
|
||||
constructor(private apiService: AlfrescoApiService,
|
||||
|
@ -22,7 +22,9 @@ import { AlfrescoApiService } from './alfresco-api.service';
|
||||
import { SitePaging, SiteEntry } from 'alfresco-js-api';
|
||||
import { catchError } from 'rxjs/operators';
|
||||
|
||||
@Injectable()
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class SitesService {
|
||||
|
||||
constructor(
|
||||
|
@ -17,7 +17,9 @@
|
||||
|
||||
import { Injectable } from '@angular/core';
|
||||
|
||||
@Injectable()
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class StorageService {
|
||||
|
||||
private memoryStore: { [key: string]: any } = {};
|
||||
|
@ -20,7 +20,9 @@ import { MatIconRegistry } from '@angular/material';
|
||||
import { DomSanitizer } from '@angular/platform-browser';
|
||||
import { ContentService } from './content.service';
|
||||
|
||||
@Injectable()
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class ThumbnailService {
|
||||
|
||||
DEFAULT_ICON: string = './assets/images/ft_ic_miscellaneous.svg';
|
||||
|
@ -24,7 +24,9 @@ import { ComponentTranslationModel } from '../models/component.model';
|
||||
import { ObjectUtils } from '../utils/object-utils';
|
||||
import { map, catchError, retry } from 'rxjs/operators';
|
||||
|
||||
@Injectable()
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class TranslateLoaderService implements TranslateLoader {
|
||||
|
||||
private prefix: string = 'i18n';
|
||||
|
@ -22,11 +22,8 @@ import { TranslateLoader, TranslateModule } from '@ngx-translate/core';
|
||||
|
||||
import { TranslateLoaderService } from './translate-loader.service';
|
||||
import { TRANSLATION_PROVIDER, TranslationService } from './translation.service';
|
||||
import { LogService } from './log.service';
|
||||
import { AppConfigService } from '../app-config/app-config.service';
|
||||
import { AppConfigServiceMock } from '../mock/app-config.service.mock';
|
||||
import { UserPreferencesService } from './user-preferences.service';
|
||||
import { StorageService } from './storage.service';
|
||||
import { AlfrescoApiService } from './alfresco-api.service';
|
||||
import { AlfrescoApiServiceMock } from '../mock/alfresco-api.service.mock';
|
||||
|
||||
@ -49,11 +46,7 @@ describe('TranslationService', () => {
|
||||
],
|
||||
providers: [
|
||||
{ provide: AlfrescoApiService, useClass: AlfrescoApiServiceMock },
|
||||
LogService,
|
||||
{ provide: AppConfigService, useClass: AppConfigServiceMock },
|
||||
UserPreferencesService,
|
||||
StorageService,
|
||||
TranslationService,
|
||||
{
|
||||
provide: TRANSLATION_PROVIDER,
|
||||
multi: true,
|
||||
|
@ -28,7 +28,9 @@ export interface TranslationProvider {
|
||||
source: string;
|
||||
}
|
||||
|
||||
@Injectable()
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class TranslationService {
|
||||
defaultLang: string;
|
||||
userLang: string;
|
||||
|
@ -28,7 +28,9 @@ import {
|
||||
import { FileModel, FileUploadProgress, FileUploadStatus } from '../models/file.model';
|
||||
import { AlfrescoApiService } from './alfresco-api.service';
|
||||
|
||||
@Injectable()
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class UploadService {
|
||||
|
||||
private cache: { [key: string]: any } = {};
|
||||
|
@ -28,7 +28,9 @@ export enum UserPreferenceValues {
|
||||
SupportedPageSizes = 'supportedPageSizes'
|
||||
}
|
||||
|
||||
@Injectable()
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class UserPreferencesService {
|
||||
|
||||
defaults = {
|
||||
|
@ -28,7 +28,9 @@ import { map, catchError } from 'rxjs/operators';
|
||||
* BPMUserService retrieve all the information of an Ecm user.
|
||||
*
|
||||
*/
|
||||
@Injectable()
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class BpmUserService {
|
||||
|
||||
constructor(private apiService: AlfrescoApiService,
|
||||
|
@ -24,7 +24,9 @@ import { AlfrescoApiService } from '../../services/alfresco-api.service';
|
||||
import { LogService } from '../../services/log.service';
|
||||
import { EcmUserModel } from '../models/ecm-user.model';
|
||||
|
||||
@Injectable()
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class EcmUserService {
|
||||
|
||||
constructor(private apiService: AlfrescoApiService,
|
||||
|
@ -22,7 +22,9 @@ import { AttachFileWidgetDialogComponentData } from './attach-file-widget-dialog
|
||||
import { MinimalNodeEntryEntity } from 'alfresco-js-api';
|
||||
import { AttachFileWidgetDialogComponent } from './attach-file-widget-dialog.component';
|
||||
|
||||
@Injectable()
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class AttachFileWidgetDialogService {
|
||||
|
||||
/** Emitted when an error occurs. */
|
||||
|
@ -21,7 +21,9 @@ import { Observable, from, forkJoin, throwError } from 'rxjs';
|
||||
import { FilterProcessRepresentationModel } from '../models/filter-process.model';
|
||||
import { map, catchError } from 'rxjs/operators';
|
||||
|
||||
@Injectable()
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class ProcessFilterService {
|
||||
|
||||
constructor(private alfrescoApiService: AlfrescoApiService) {
|
||||
|
@ -28,7 +28,9 @@ import { map, catchError } from 'rxjs/operators';
|
||||
|
||||
declare let moment: any;
|
||||
|
||||
@Injectable()
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class ProcessService {
|
||||
|
||||
constructor(private alfrescoApiService: AlfrescoApiService) {
|
||||
|
@ -28,25 +28,6 @@ import { AppsListModule } from './app-list/apps-list.module';
|
||||
import { ProcessCommentsModule } from './process-comments/process-comments.module';
|
||||
import { AttachmentModule } from './attachment/attachment.module';
|
||||
import { PeopleModule } from './people/people.module';
|
||||
import { ProcessService } from './process-list/services/process.service';
|
||||
import { ProcessFilterService } from './process-list/services/process-filter.service';
|
||||
import { TaskListService } from './task-list/services/tasklist.service';
|
||||
import { TaskFilterService } from './task-list/services/task-filter.service';
|
||||
import { TaskUploadService } from './task-list/services/task-upload.service';
|
||||
import { ProcessUploadService } from './task-list/services/process-upload.service';
|
||||
import { AttachFileWidgetDialogService } from './content-widget/attach-file-widget-dialog.service';
|
||||
|
||||
export function providers() {
|
||||
return [
|
||||
ProcessService,
|
||||
ProcessFilterService,
|
||||
TaskListService,
|
||||
TaskFilterService,
|
||||
TaskUploadService,
|
||||
ProcessUploadService,
|
||||
AttachFileWidgetDialogService
|
||||
];
|
||||
}
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
@ -63,7 +44,6 @@ export function providers() {
|
||||
PeopleModule
|
||||
],
|
||||
providers: [
|
||||
...providers(),
|
||||
{
|
||||
provide: TRANSLATION_PROVIDER,
|
||||
multi: true,
|
||||
@ -90,7 +70,6 @@ export class ProcessModule {
|
||||
return {
|
||||
ngModule: ProcessModule,
|
||||
providers: [
|
||||
...providers(),
|
||||
{
|
||||
provide: TRANSLATION_PROVIDER,
|
||||
multi: true,
|
||||
|
@ -19,7 +19,9 @@ import { AlfrescoApiService, AppConfigService, UploadService } from '@alfresco/a
|
||||
import { Injectable } from '@angular/core';
|
||||
import { throwError } from 'rxjs';
|
||||
|
||||
@Injectable()
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class ProcessUploadService extends UploadService {
|
||||
|
||||
constructor(apiService: AlfrescoApiService, appConfigService: AppConfigService) {
|
||||
|
@ -21,7 +21,9 @@ import { Observable, forkJoin, from, throwError } from 'rxjs';
|
||||
import { FilterRepresentationModel } from '../models/filter.model';
|
||||
import { map, catchError } from 'rxjs/operators';
|
||||
|
||||
@Injectable()
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class TaskFilterService {
|
||||
|
||||
constructor(private apiService: AlfrescoApiService,
|
||||
|
@ -19,7 +19,9 @@ import { AlfrescoApiService, AppConfigService, UploadService } from '@alfresco/a
|
||||
import { Injectable } from '@angular/core';
|
||||
import { throwError } from 'rxjs';
|
||||
|
||||
@Injectable()
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class TaskUploadService extends UploadService {
|
||||
|
||||
constructor(apiService: AlfrescoApiService, appConfigService: AppConfigService) {
|
||||
|
@ -24,7 +24,9 @@ import { Form } from '../models/form.model';
|
||||
import { TaskDetailsModel } from '../models/task-details.model';
|
||||
import { TaskListModel } from '../models/task-list.model';
|
||||
|
||||
@Injectable()
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class TaskListService {
|
||||
|
||||
constructor(private apiService: AlfrescoApiService,
|
||||
|
Loading…
x
Reference in New Issue
Block a user