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 |
ys9693 | 16a9fce | 2020-01-19 13:50:02 +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 |
ys9693 | 16a9fce | 2020-01-19 13:50:02 +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 | |
ys9693 | 16a9fce | 2020-01-19 13:50:02 +0200 | [diff] [blame] | 21 | import { downgradeInjectable } from '@angular/upgrade/static'; |
| 22 | import { CompositionService } from 'app/ng2/pages/composition/composition.service'; |
| 23 | import { CatalogService } from 'app/ng2/services/catalog.service'; |
| 24 | import { TopologyTemplateService } from 'app/ng2/services/component-services/topology-template.service'; |
| 25 | import { DynamicComponentService } from 'app/ng2/services/dynamic-component.service'; |
Piotr Darosz | 2c25cba | 2019-03-27 15:25:50 +0100 | [diff] [blame] | 26 | import {GabService as GabServiceNg2} from "app/ng2/services/gab.service"; |
ys9693 | 16a9fce | 2020-01-19 13:50:02 +0200 | [diff] [blame] | 27 | import { ComponentFactory } from 'app/utils/component-factory'; |
| 28 | import { SdcUiServices } from 'onap-ui-angular'; |
| 29 | import { NodesFactory } from '../models/graph/nodes/nodes-factory'; |
| 30 | import { ImportVSPService } from '../ng2/components/modals/onboarding-modal/import-vsp.service'; |
| 31 | import { AutomatedUpgradeService } from '../ng2/pages/automated-upgrade/automated-upgrade.service'; |
| 32 | import { ConnectionWizardService } from '../ng2/pages/composition/graph/connection-wizard/connection-wizard.service'; |
| 33 | import { WorkspaceNg1BridgeService } from '../ng2/pages/workspace/workspace-ng1-bridge-service'; |
| 34 | import { WorkspaceService } from '../ng2/pages/workspace/workspace.service'; |
| 35 | import { AuthenticationService as AuthenticationServiceNg2 } from '../ng2/services/authentication.service'; |
| 36 | import { CacheService } from '../ng2/services/cache.service'; |
| 37 | import { ComponentInstanceServiceNg2 } from '../ng2/services/component-instance-services/component-instance.service'; |
| 38 | import { ComponentServiceNg2 } from '../ng2/services/component-services/component.service'; |
| 39 | import { ComponentServiceFactoryNg2 } from '../ng2/services/component-services/component.service.factory'; |
| 40 | import { ServiceServiceNg2 } from '../ng2/services/component-services/service.service'; |
| 41 | import { EventBusService } from '../ng2/services/event-bus.service'; |
| 42 | import { GroupsService as GroupsServiceNg2 } from '../ng2/services/groups.service'; |
| 43 | import { HomeService } from '../ng2/services/home.service'; |
| 44 | import { ModalService } from '../ng2/services/modal.service'; |
| 45 | import { OnboardingService } from '../ng2/services/onboarding.service'; |
| 46 | import { PluginsService } from '../ng2/services/plugins.service'; |
| 47 | import { PoliciesService as PoliciesServiceNg2 } from '../ng2/services/policies.service'; |
| 48 | import { SharingService } from '../ng2/services/sharing.service'; |
| 49 | import { ToscaTypesServiceNg2 } from '../ng2/services/tosca-types.service'; |
| 50 | import { UserService as UserServiceNg2 } from '../ng2/services/user.service'; |
| 51 | import { AngularJSBridge } from '../services/angular-js-bridge-service'; |
| 52 | import { AvailableIconsService } from '../services/available-icons-service'; |
| 53 | import { CategoryResourceService } from '../services/category-resource-service'; |
| 54 | import { ComponentService } from '../services/components/component-service'; |
| 55 | import { ResourceService } from '../services/components/resource-service'; |
| 56 | import { ServiceService } from '../services/components/service-service'; |
| 57 | import { LeftPaletteLoaderService } from '../services/components/utils/composition-left-palette-service'; |
| 58 | import { ConfigurationUiService } from '../services/configuration-ui-service'; |
| 59 | import { CookieService } from '../services/cookie-service'; |
| 60 | import { DataTypesService } from '../services/data-types-service'; |
| 61 | import { EcompHeaderService } from '../services/ecomp-service'; |
| 62 | import { EventListenerService } from '../services/event-listener-service'; |
| 63 | import { HeaderInterceptor } from '../services/header-interceptor'; |
| 64 | import { LoaderService } from '../services/loader-service'; |
| 65 | import { ProgressService } from '../services/progress-service'; |
| 66 | import { SdcVersionService } from '../services/sdc-version-service'; |
| 67 | import { UrlToBase64Service } from '../services/url-tobase64-service'; |
| 68 | import { FileUtils } from '../utils/file-utils'; |
| 69 | import { ValidationUtils } from '../utils/validation-utils'; |
| 70 | import {ReqAndCapabilitiesService} from "../ng2/pages/workspace/req-and-capabilities/req-and-capabilities.service"; |
Michael Lando | ed64b5e | 2017-06-09 03:19:04 +0300 | [diff] [blame] | 71 | |
ys9693 | 16a9fce | 2020-01-19 13:50:02 +0200 | [diff] [blame] | 72 | const moduleName: string = 'Sdc.Services'; |
| 73 | const serviceModule: ng.IModule = angular.module(moduleName, []); |
Michael Lando | ed64b5e | 2017-06-09 03:19:04 +0300 | [diff] [blame] | 74 | |
| 75 | serviceModule.service('Sdc.Services.ConfigurationUiService', ConfigurationUiService); |
| 76 | serviceModule.service('Sdc.Services.CookieService', CookieService); |
Michael Lando | 5b59349 | 2018-07-29 16:13:45 +0300 | [diff] [blame] | 77 | 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] | 78 | serviceModule.service('Sdc.Services.AvailableIconsService', AvailableIconsService); |
| 79 | serviceModule.service('Sdc.Services.UrlToBase64Service', UrlToBase64Service); |
Michael Lando | ed64b5e | 2017-06-09 03:19:04 +0300 | [diff] [blame] | 80 | serviceModule.service('Sdc.Services.HeaderInterceptor', HeaderInterceptor); |
Michael Lando | ed64b5e | 2017-06-09 03:19:04 +0300 | [diff] [blame] | 81 | serviceModule.service('Sdc.Services.SdcVersionService', SdcVersionService); |
Michael Lando | ed64b5e | 2017-06-09 03:19:04 +0300 | [diff] [blame] | 82 | serviceModule.service('Sdc.Services.EcompHeaderService', EcompHeaderService); |
| 83 | serviceModule.service('Sdc.Services.DataTypesService', DataTypesService); |
| 84 | |
ys9693 | 16a9fce | 2020-01-19 13:50:02 +0200 | [diff] [blame] | 85 | // Components Services |
Michael Lando | ed64b5e | 2017-06-09 03:19:04 +0300 | [diff] [blame] | 86 | serviceModule.service('Sdc.Services.Components.ComponentService', ComponentService); |
ys9693 | 16a9fce | 2020-01-19 13:50:02 +0200 | [diff] [blame] | 87 | serviceModule.service('Sdc.Services.Components.ServiceService', ServiceService); |
Michael Lando | ed64b5e | 2017-06-09 03:19:04 +0300 | [diff] [blame] | 88 | serviceModule.service('Sdc.Services.Components.ResourceService', ResourceService); |
Michael Lando | ed64b5e | 2017-06-09 03:19:04 +0300 | [diff] [blame] | 89 | serviceModule.service('LeftPaletteLoaderService', LeftPaletteLoaderService); |
Michael Lando | ed64b5e | 2017-06-09 03:19:04 +0300 | [diff] [blame] | 90 | serviceModule.service('Sdc.Services.ProgressService', ProgressService); |
| 91 | |
ys9693 | 16a9fce | 2020-01-19 13:50:02 +0200 | [diff] [blame] | 92 | // Utils |
Michael Lando | ed64b5e | 2017-06-09 03:19:04 +0300 | [diff] [blame] | 93 | serviceModule.service('FileUtils', FileUtils); |
| 94 | serviceModule.service('ValidationUtils', ValidationUtils); |
ys9693 | 16a9fce | 2020-01-19 13:50:02 +0200 | [diff] [blame] | 95 | serviceModule.service('AngularJSBridge', AngularJSBridge); |
Michael Lando | ed64b5e | 2017-06-09 03:19:04 +0300 | [diff] [blame] | 96 | serviceModule.service('LoaderService', LoaderService); |
Michael Lando | ed64b5e | 2017-06-09 03:19:04 +0300 | [diff] [blame] | 97 | serviceModule.factory('Sdc.Services.CategoryResourceService', CategoryResourceService.getResource); |
Tal Gitelman | 51d50f0 | 2017-12-10 18:55:03 +0200 | [diff] [blame] | 98 | |
| 99 | // Angular2 upgraded services - This is in order to use the service in angular1 till we finish remove all angular1 code |
ys9693 | 16a9fce | 2020-01-19 13:50:02 +0200 | [diff] [blame] | 100 | serviceModule.service('Sdc.Services.SharingService', downgradeInjectable(SharingService)); |
| 101 | serviceModule.service('Sdc.Services.CacheService', downgradeInjectable(CacheService)); |
Tal Gitelman | 51d50f0 | 2017-12-10 18:55:03 +0200 | [diff] [blame] | 102 | serviceModule.factory('ComponentServiceNg2', downgradeInjectable(ComponentServiceNg2)); |
ys9693 | 16a9fce | 2020-01-19 13:50:02 +0200 | [diff] [blame] | 103 | serviceModule.factory('TopologyTemplateService', downgradeInjectable(TopologyTemplateService)); |
| 104 | serviceModule.factory('WorkspaceNg1BridgeService', downgradeInjectable(WorkspaceNg1BridgeService)); |
| 105 | serviceModule.factory('workspaceService', downgradeInjectable(WorkspaceService)); |
Michael Lando | a544510 | 2018-03-04 14:53:33 +0200 | [diff] [blame] | 106 | serviceModule.factory('ComponentServiceFactoryNg2', downgradeInjectable(ComponentServiceFactoryNg2)); |
Tal Gitelman | 51d50f0 | 2017-12-10 18:55:03 +0200 | [diff] [blame] | 107 | serviceModule.factory('ServiceServiceNg2', downgradeInjectable(ServiceServiceNg2)); |
| 108 | serviceModule.factory('ModalServiceNg2', downgradeInjectable(ModalService)); |
ys9693 | 16a9fce | 2020-01-19 13:50:02 +0200 | [diff] [blame] | 109 | serviceModule.factory('ModalServiceSdcUI', downgradeInjectable(SdcUiServices.ModalService)); |
Tal Gitelman | 51d50f0 | 2017-12-10 18:55:03 +0200 | [diff] [blame] | 110 | serviceModule.factory('ConnectionWizardServiceNg2', downgradeInjectable(ConnectionWizardService)); |
| 111 | serviceModule.factory('ComponentInstanceServiceNg2', downgradeInjectable(ComponentInstanceServiceNg2)); |
Idan Amit | ae4ab93 | 2018-01-23 15:53:11 +0200 | [diff] [blame] | 112 | serviceModule.factory('UserServiceNg2', downgradeInjectable(UserServiceNg2)); |
ys9693 | 16a9fce | 2020-01-19 13:50:02 +0200 | [diff] [blame] | 113 | serviceModule.factory('AuthenticationServiceNg2', downgradeInjectable(AuthenticationServiceNg2)); |
Michael Lando | 5b59349 | 2018-07-29 16:13:45 +0300 | [diff] [blame] | 114 | serviceModule.factory('PoliciesServiceNg2', downgradeInjectable(PoliciesServiceNg2)); |
| 115 | serviceModule.factory('GroupsServiceNg2', downgradeInjectable(GroupsServiceNg2)); |
Idan Amit | eedaaf9 | 2018-01-31 13:27:33 +0200 | [diff] [blame] | 116 | serviceModule.factory('PluginsService', downgradeInjectable(PluginsService)); |
Idan Amit | f97bae3 | 2018-03-06 13:52:58 +0200 | [diff] [blame] | 117 | serviceModule.factory('EventBusService', downgradeInjectable(EventBusService)); |
Michael Lando | a544510 | 2018-03-04 14:53:33 +0200 | [diff] [blame] | 118 | serviceModule.factory('DynamicComponentService', downgradeInjectable(DynamicComponentService)); |
ys9693 | 16a9fce | 2020-01-19 13:50:02 +0200 | [diff] [blame] | 119 | serviceModule.factory('HomeService', downgradeInjectable(HomeService)); |
| 120 | serviceModule.factory('CatalogService', downgradeInjectable(CatalogService)); |
Piotr Darosz | 2c25cba | 2019-03-27 15:25:50 +0100 | [diff] [blame] | 121 | serviceModule.factory('GabServiceNg2', downgradeInjectable(GabServiceNg2)); |
Michael Lando | 5b59349 | 2018-07-29 16:13:45 +0300 | [diff] [blame] | 122 | serviceModule.factory('AutomatedUpgradeService', downgradeInjectable(AutomatedUpgradeService)); |
miriame | 41ee9cb | 2019-03-04 13:49:15 +0200 | [diff] [blame] | 123 | serviceModule.factory('ToscaTypesServiceNg2', downgradeInjectable(ToscaTypesServiceNg2)); |
ys9693 | 16a9fce | 2020-01-19 13:50:02 +0200 | [diff] [blame] | 124 | serviceModule.factory('EventListenerService', downgradeInjectable(EventListenerService)); |
| 125 | serviceModule.factory('CompositionService', downgradeInjectable(CompositionService)); |
| 126 | serviceModule.factory('ReqAndCapabilitiesService', downgradeInjectable(ReqAndCapabilitiesService)); |
| 127 | serviceModule.factory('NodesFactory', downgradeInjectable(NodesFactory)); |
| 128 | serviceModule.service('OnboardingService', downgradeInjectable(OnboardingService)); |
| 129 | serviceModule.service('ImportVSPService', downgradeInjectable(ImportVSPService)); |