mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +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
@@ -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,
|
||||
|
Reference in New Issue
Block a user