Michael Lando | dd60339 | 2017-07-12 00:54:52 +0300 | [diff] [blame] | 1 | /*- |
| 2 | * ============LICENSE_START======================================================= |
| 3 | * SDC |
| 4 | * ================================================================================ |
| 5 | * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. |
| 6 | * ================================================================================ |
| 7 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 8 | * you may not use this file except in compliance with the License. |
| 9 | * You may obtain a copy of the License at |
Michael Lando | a544510 | 2018-03-04 14:53:33 +0200 | [diff] [blame] | 10 | * |
Michael Lando | dd60339 | 2017-07-12 00:54:52 +0300 | [diff] [blame] | 11 | * http://www.apache.org/licenses/LICENSE-2.0 |
Michael Lando | a544510 | 2018-03-04 14:53:33 +0200 | [diff] [blame] | 12 | * |
Michael Lando | dd60339 | 2017-07-12 00:54:52 +0300 | [diff] [blame] | 13 | * Unless required by applicable law or agreed to in writing, software |
| 14 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 16 | * See the License for the specific language governing permissions and |
| 17 | * limitations under the License. |
| 18 | * ============LICENSE_END========================================================= |
| 19 | */ |
| 20 | |
Michael Lando | ed64b5e | 2017-06-09 03:19:04 +0300 | [diff] [blame] | 21 | import {ConfigurationUiService} from "../services/configuration-ui-service"; |
| 22 | import {CookieService} from "../services/cookie-service"; |
| 23 | import {EntityService} from "../services/entity-service"; |
| 24 | import {AvailableIconsService} from "../services/available-icons-service"; |
| 25 | import {UrlToBase64Service} from "../services/url-tobase64-service"; |
| 26 | import {CacheService} from "../services/cache-service"; |
| 27 | import {HeaderInterceptor} from "../services/header-interceptor"; |
| 28 | import {HttpErrorInterceptor} from "../services/http-error-interceptor"; |
| 29 | import {SharingService} from "../services/sharing-service"; |
| 30 | import {SdcVersionService} from "../services/sdc-version-service"; |
| 31 | import {ActivityLogService} from "../services/activity-log-service"; |
| 32 | import {OnboardingService} from "../services/onboarding-service"; |
| 33 | import {EcompHeaderService} from "../services/ecomp-service"; |
| 34 | import {DataTypesService} from "../services/data-types-service"; |
| 35 | import {ComponentService} from "../services/components/component-service"; |
| 36 | import {ServiceService} from "../services/components/service-service"; |
| 37 | import {ResourceService} from "../services/components/resource-service"; |
Michael Lando | ed64b5e | 2017-06-09 03:19:04 +0300 | [diff] [blame] | 38 | import {LeftPaletteLoaderService} from "../services/components/utils/composition-left-palette-service"; |
| 39 | import {EventListenerService} from "../services/event-listener-service"; |
| 40 | import {ProgressService} from "../services/progress-service"; |
| 41 | import {ArtifactsUtils} from "../utils/artifacts-utils"; |
| 42 | import {FileUtils} from "../utils/file-utils"; |
| 43 | import {ValidationUtils} from "../utils/validation-utils"; |
| 44 | import {AngularJSBridge} from "../services/angular-js-bridge-service"; |
| 45 | import {LoaderService} from "../services/loader-service"; |
Michael Lando | ed64b5e | 2017-06-09 03:19:04 +0300 | [diff] [blame] | 46 | import {CategoryResourceService} from "../services/category-resource-service"; |
Tal Gitelman | 51d50f0 | 2017-12-10 18:55:03 +0200 | [diff] [blame] | 47 | import {downgradeInjectable} from "@angular/upgrade/static"; |
| 48 | import {ModalService} from "../ng2/services/modal.service"; |
Michael Lando | 5b59349 | 2018-07-29 16:13:45 +0300 | [diff] [blame] | 49 | import {SdcUiComponents} from "sdc-ui/lib/angular"; |
Tal Gitelman | 51d50f0 | 2017-12-10 18:55:03 +0200 | [diff] [blame] | 50 | import {ComponentServiceNg2} from "../ng2/services/component-services/component.service"; |
| 51 | import {ServiceServiceNg2} from "../ng2/services/component-services/service.service"; |
Michael Lando | a544510 | 2018-03-04 14:53:33 +0200 | [diff] [blame] | 52 | import {ComponentServiceFactoryNg2} from "../ng2/services/component-services/component.service.factory"; |
Tal Gitelman | 51d50f0 | 2017-12-10 18:55:03 +0200 | [diff] [blame] | 53 | import {ConnectionWizardService} from "../ng2/pages/connection-wizard/connection-wizard.service"; |
| 54 | import {ComponentInstanceServiceNg2} from "../ng2/services/component-instance-services/component-instance.service"; |
| 55 | import {UserService as UserServiceNg2} from "../ng2/services/user.service"; |
Michael Lando | 5b59349 | 2018-07-29 16:13:45 +0300 | [diff] [blame] | 56 | import {PoliciesService as PoliciesServiceNg2} from "../ng2/services/policies.service"; |
| 57 | import {GroupsService as GroupsServiceNg2} from "../ng2/services/groups.service"; |
Idan Amit | eedaaf9 | 2018-01-31 13:27:33 +0200 | [diff] [blame] | 58 | import {PluginsService} from "../ng2/services/plugins.service"; |
Idan Amit | f97bae3 | 2018-03-06 13:52:58 +0200 | [diff] [blame] | 59 | import {EventBusService} from "../ng2/services/event-bus.service"; |
Michael Lando | a544510 | 2018-03-04 14:53:33 +0200 | [diff] [blame] | 60 | import {DynamicComponentService} from "app/ng2/services/dynamic-component.service"; |
Michael Lando | 5b59349 | 2018-07-29 16:13:45 +0300 | [diff] [blame] | 61 | import {AutomatedUpgradeService} from "../ng2/pages/automated-upgrade/automated-upgrade.service"; |
| 62 | import {ArchiveService as ArchiveServiceNg2} from "app/ng2/services/archive.service"; |
| 63 | import {ComponentFactory} from "app/utils/component-factory"; |
Michael Lando | ed64b5e | 2017-06-09 03:19:04 +0300 | [diff] [blame] | 64 | |
| 65 | let moduleName:string = 'Sdc.Services'; |
| 66 | let serviceModule:ng.IModule = angular.module(moduleName, []); |
| 67 | |
| 68 | serviceModule.service('Sdc.Services.ConfigurationUiService', ConfigurationUiService); |
| 69 | serviceModule.service('Sdc.Services.CookieService', CookieService); |
Michael Lando | 5b59349 | 2018-07-29 16:13:45 +0300 | [diff] [blame] | 70 | serviceModule.service('Sdc.Services.ComponentFactory', ComponentFactory); // Why you need to declare it again, already done in utils.ts |
Michael Lando | ed64b5e | 2017-06-09 03:19:04 +0300 | [diff] [blame] | 71 | serviceModule.service('Sdc.Services.EntityService', EntityService); |
| 72 | serviceModule.service('Sdc.Services.AvailableIconsService', AvailableIconsService); |
| 73 | serviceModule.service('Sdc.Services.UrlToBase64Service', UrlToBase64Service); |
| 74 | serviceModule.service('Sdc.Services.CacheService', CacheService); |
| 75 | serviceModule.service('Sdc.Services.HeaderInterceptor', HeaderInterceptor); |
| 76 | serviceModule.service('Sdc.Services.HttpErrorInterceptor', HttpErrorInterceptor); |
| 77 | serviceModule.service('Sdc.Services.SharingService', SharingService); |
| 78 | serviceModule.service('Sdc.Services.SdcVersionService', SdcVersionService); |
| 79 | serviceModule.service('Sdc.Services.ActivityLogService', ActivityLogService); |
| 80 | serviceModule.service('Sdc.Services.OnboardingService', OnboardingService); |
| 81 | serviceModule.service('Sdc.Services.EcompHeaderService', EcompHeaderService); |
| 82 | serviceModule.service('Sdc.Services.DataTypesService', DataTypesService); |
| 83 | |
| 84 | //Components Services |
| 85 | serviceModule.service('Sdc.Services.Components.ComponentService', ComponentService); |
| 86 | serviceModule.service('Sdc.Services.Components.ServiceService',ServiceService); |
| 87 | serviceModule.service('Sdc.Services.Components.ResourceService', ResourceService); |
Michael Lando | ed64b5e | 2017-06-09 03:19:04 +0300 | [diff] [blame] | 88 | serviceModule.service('LeftPaletteLoaderService', LeftPaletteLoaderService); |
| 89 | serviceModule.service('EventListenerService', EventListenerService); |
| 90 | serviceModule.service('Sdc.Services.ProgressService', ProgressService); |
| 91 | |
| 92 | //Utils |
| 93 | serviceModule.service('ArtifactsUtils', ArtifactsUtils); |
| 94 | serviceModule.service('FileUtils', FileUtils); |
| 95 | serviceModule.service('ValidationUtils', ValidationUtils); |
| 96 | |
| 97 | serviceModule.service('AngularJSBridge',AngularJSBridge); |
| 98 | serviceModule.service('LoaderService', LoaderService); |
| 99 | |
Michael Lando | ed64b5e | 2017-06-09 03:19:04 +0300 | [diff] [blame] | 100 | serviceModule.factory('Sdc.Services.CategoryResourceService', CategoryResourceService.getResource); |
Tal Gitelman | 51d50f0 | 2017-12-10 18:55:03 +0200 | [diff] [blame] | 101 | |
| 102 | // Angular2 upgraded services - This is in order to use the service in angular1 till we finish remove all angular1 code |
| 103 | serviceModule.factory('ComponentServiceNg2', downgradeInjectable(ComponentServiceNg2)); |
Michael Lando | a544510 | 2018-03-04 14:53:33 +0200 | [diff] [blame] | 104 | serviceModule.factory('ComponentServiceFactoryNg2', downgradeInjectable(ComponentServiceFactoryNg2)); |
Tal Gitelman | 51d50f0 | 2017-12-10 18:55:03 +0200 | [diff] [blame] | 105 | serviceModule.factory('ServiceServiceNg2', downgradeInjectable(ServiceServiceNg2)); |
| 106 | serviceModule.factory('ModalServiceNg2', downgradeInjectable(ModalService)); |
Michael Lando | 5b59349 | 2018-07-29 16:13:45 +0300 | [diff] [blame] | 107 | serviceModule.factory('ModalServiceSdcUI', downgradeInjectable(SdcUiComponents.ModalService)); |
Tal Gitelman | 51d50f0 | 2017-12-10 18:55:03 +0200 | [diff] [blame] | 108 | serviceModule.factory('ConnectionWizardServiceNg2', downgradeInjectable(ConnectionWizardService)); |
| 109 | serviceModule.factory('ComponentInstanceServiceNg2', downgradeInjectable(ComponentInstanceServiceNg2)); |
Idan Amit | ae4ab93 | 2018-01-23 15:53:11 +0200 | [diff] [blame] | 110 | serviceModule.factory('UserServiceNg2', downgradeInjectable(UserServiceNg2)); |
Michael Lando | 5b59349 | 2018-07-29 16:13:45 +0300 | [diff] [blame] | 111 | serviceModule.factory('PoliciesServiceNg2', downgradeInjectable(PoliciesServiceNg2)); |
| 112 | serviceModule.factory('GroupsServiceNg2', downgradeInjectable(GroupsServiceNg2)); |
Idan Amit | eedaaf9 | 2018-01-31 13:27:33 +0200 | [diff] [blame] | 113 | serviceModule.factory('PluginsService', downgradeInjectable(PluginsService)); |
Idan Amit | f97bae3 | 2018-03-06 13:52:58 +0200 | [diff] [blame] | 114 | serviceModule.factory('EventBusService', downgradeInjectable(EventBusService)); |
Michael Lando | a544510 | 2018-03-04 14:53:33 +0200 | [diff] [blame] | 115 | serviceModule.factory('DynamicComponentService', downgradeInjectable(DynamicComponentService)); |
Michael Lando | 5b59349 | 2018-07-29 16:13:45 +0300 | [diff] [blame] | 116 | serviceModule.factory('ArchiveServiceNg2', downgradeInjectable(ArchiveServiceNg2)); |
| 117 | serviceModule.factory('AutomatedUpgradeService', downgradeInjectable(AutomatedUpgradeService)); |