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'; |
vasraz | a6ae729 | 2021-03-21 20:48:30 +0000 | [diff] [blame] | 46 | import { ElementService } from '../ng2/services/element.service'; |
aribeiro | 53df976 | 2021-06-16 23:21:04 +0100 | [diff] [blame] | 47 | import { ModelService } from '../ng2/services/model.service'; |
ys9693 | 16a9fce | 2020-01-19 13:50:02 +0200 | [diff] [blame] | 48 | import { PluginsService } from '../ng2/services/plugins.service'; |
| 49 | import { PoliciesService as PoliciesServiceNg2 } from '../ng2/services/policies.service'; |
| 50 | import { SharingService } from '../ng2/services/sharing.service'; |
| 51 | import { ToscaTypesServiceNg2 } from '../ng2/services/tosca-types.service'; |
| 52 | import { UserService as UserServiceNg2 } from '../ng2/services/user.service'; |
| 53 | import { AngularJSBridge } from '../services/angular-js-bridge-service'; |
| 54 | import { AvailableIconsService } from '../services/available-icons-service'; |
| 55 | import { CategoryResourceService } from '../services/category-resource-service'; |
| 56 | import { ComponentService } from '../services/components/component-service'; |
| 57 | import { ResourceService } from '../services/components/resource-service'; |
| 58 | import { ServiceService } from '../services/components/service-service'; |
| 59 | import { LeftPaletteLoaderService } from '../services/components/utils/composition-left-palette-service'; |
| 60 | import { ConfigurationUiService } from '../services/configuration-ui-service'; |
| 61 | import { CookieService } from '../services/cookie-service'; |
| 62 | import { DataTypesService } from '../services/data-types-service'; |
| 63 | import { EcompHeaderService } from '../services/ecomp-service'; |
| 64 | import { EventListenerService } from '../services/event-listener-service'; |
| 65 | import { HeaderInterceptor } from '../services/header-interceptor'; |
| 66 | import { LoaderService } from '../services/loader-service'; |
| 67 | import { ProgressService } from '../services/progress-service'; |
| 68 | import { SdcVersionService } from '../services/sdc-version-service'; |
| 69 | import { UrlToBase64Service } from '../services/url-tobase64-service'; |
| 70 | import { FileUtils } from '../utils/file-utils'; |
| 71 | import { ValidationUtils } from '../utils/validation-utils'; |
| 72 | import {ReqAndCapabilitiesService} from "../ng2/pages/workspace/req-and-capabilities/req-and-capabilities.service"; |
aribeiro | 1de1692 | 2021-10-01 11:30:49 +0100 | [diff] [blame] | 73 | import {ToscaArtifactService} from "../ng2/services/tosca-artifact.service"; |
Michael Lando | ed64b5e | 2017-06-09 03:19:04 +0300 | [diff] [blame] | 74 | |
ys9693 | 16a9fce | 2020-01-19 13:50:02 +0200 | [diff] [blame] | 75 | const moduleName: string = 'Sdc.Services'; |
| 76 | const serviceModule: ng.IModule = angular.module(moduleName, []); |
Michael Lando | ed64b5e | 2017-06-09 03:19:04 +0300 | [diff] [blame] | 77 | |
| 78 | serviceModule.service('Sdc.Services.ConfigurationUiService', ConfigurationUiService); |
| 79 | serviceModule.service('Sdc.Services.CookieService', CookieService); |
Michael Lando | 5b59349 | 2018-07-29 16:13:45 +0300 | [diff] [blame] | 80 | 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] | 81 | serviceModule.service('Sdc.Services.AvailableIconsService', AvailableIconsService); |
| 82 | serviceModule.service('Sdc.Services.UrlToBase64Service', UrlToBase64Service); |
Michael Lando | ed64b5e | 2017-06-09 03:19:04 +0300 | [diff] [blame] | 83 | serviceModule.service('Sdc.Services.HeaderInterceptor', HeaderInterceptor); |
Michael Lando | ed64b5e | 2017-06-09 03:19:04 +0300 | [diff] [blame] | 84 | serviceModule.service('Sdc.Services.SdcVersionService', SdcVersionService); |
Michael Lando | ed64b5e | 2017-06-09 03:19:04 +0300 | [diff] [blame] | 85 | serviceModule.service('Sdc.Services.EcompHeaderService', EcompHeaderService); |
| 86 | serviceModule.service('Sdc.Services.DataTypesService', DataTypesService); |
| 87 | |
ys9693 | 16a9fce | 2020-01-19 13:50:02 +0200 | [diff] [blame] | 88 | // Components Services |
Michael Lando | ed64b5e | 2017-06-09 03:19:04 +0300 | [diff] [blame] | 89 | serviceModule.service('Sdc.Services.Components.ComponentService', ComponentService); |
ys9693 | 16a9fce | 2020-01-19 13:50:02 +0200 | [diff] [blame] | 90 | serviceModule.service('Sdc.Services.Components.ServiceService', ServiceService); |
Michael Lando | ed64b5e | 2017-06-09 03:19:04 +0300 | [diff] [blame] | 91 | serviceModule.service('Sdc.Services.Components.ResourceService', ResourceService); |
Michael Lando | ed64b5e | 2017-06-09 03:19:04 +0300 | [diff] [blame] | 92 | serviceModule.service('LeftPaletteLoaderService', LeftPaletteLoaderService); |
Michael Lando | ed64b5e | 2017-06-09 03:19:04 +0300 | [diff] [blame] | 93 | serviceModule.service('Sdc.Services.ProgressService', ProgressService); |
| 94 | |
ys9693 | 16a9fce | 2020-01-19 13:50:02 +0200 | [diff] [blame] | 95 | // Utils |
Michael Lando | ed64b5e | 2017-06-09 03:19:04 +0300 | [diff] [blame] | 96 | serviceModule.service('FileUtils', FileUtils); |
| 97 | serviceModule.service('ValidationUtils', ValidationUtils); |
ys9693 | 16a9fce | 2020-01-19 13:50:02 +0200 | [diff] [blame] | 98 | serviceModule.service('AngularJSBridge', AngularJSBridge); |
Michael Lando | ed64b5e | 2017-06-09 03:19:04 +0300 | [diff] [blame] | 99 | serviceModule.service('LoaderService', LoaderService); |
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 |
ys9693 | 16a9fce | 2020-01-19 13:50:02 +0200 | [diff] [blame] | 103 | serviceModule.service('Sdc.Services.SharingService', downgradeInjectable(SharingService)); |
| 104 | serviceModule.service('Sdc.Services.CacheService', downgradeInjectable(CacheService)); |
Tal Gitelman | 51d50f0 | 2017-12-10 18:55:03 +0200 | [diff] [blame] | 105 | serviceModule.factory('ComponentServiceNg2', downgradeInjectable(ComponentServiceNg2)); |
ys9693 | 16a9fce | 2020-01-19 13:50:02 +0200 | [diff] [blame] | 106 | serviceModule.factory('TopologyTemplateService', downgradeInjectable(TopologyTemplateService)); |
| 107 | serviceModule.factory('WorkspaceNg1BridgeService', downgradeInjectable(WorkspaceNg1BridgeService)); |
| 108 | serviceModule.factory('workspaceService', downgradeInjectable(WorkspaceService)); |
Michael Lando | a544510 | 2018-03-04 14:53:33 +0200 | [diff] [blame] | 109 | serviceModule.factory('ComponentServiceFactoryNg2', downgradeInjectable(ComponentServiceFactoryNg2)); |
Tal Gitelman | 51d50f0 | 2017-12-10 18:55:03 +0200 | [diff] [blame] | 110 | serviceModule.factory('ServiceServiceNg2', downgradeInjectable(ServiceServiceNg2)); |
| 111 | serviceModule.factory('ModalServiceNg2', downgradeInjectable(ModalService)); |
ys9693 | 16a9fce | 2020-01-19 13:50:02 +0200 | [diff] [blame] | 112 | serviceModule.factory('ModalServiceSdcUI', downgradeInjectable(SdcUiServices.ModalService)); |
Tal Gitelman | 51d50f0 | 2017-12-10 18:55:03 +0200 | [diff] [blame] | 113 | serviceModule.factory('ConnectionWizardServiceNg2', downgradeInjectable(ConnectionWizardService)); |
| 114 | serviceModule.factory('ComponentInstanceServiceNg2', downgradeInjectable(ComponentInstanceServiceNg2)); |
Idan Amit | ae4ab93 | 2018-01-23 15:53:11 +0200 | [diff] [blame] | 115 | serviceModule.factory('UserServiceNg2', downgradeInjectable(UserServiceNg2)); |
ys9693 | 16a9fce | 2020-01-19 13:50:02 +0200 | [diff] [blame] | 116 | serviceModule.factory('AuthenticationServiceNg2', downgradeInjectable(AuthenticationServiceNg2)); |
Michael Lando | 5b59349 | 2018-07-29 16:13:45 +0300 | [diff] [blame] | 117 | serviceModule.factory('PoliciesServiceNg2', downgradeInjectable(PoliciesServiceNg2)); |
| 118 | serviceModule.factory('GroupsServiceNg2', downgradeInjectable(GroupsServiceNg2)); |
Idan Amit | eedaaf9 | 2018-01-31 13:27:33 +0200 | [diff] [blame] | 119 | serviceModule.factory('PluginsService', downgradeInjectable(PluginsService)); |
Idan Amit | f97bae3 | 2018-03-06 13:52:58 +0200 | [diff] [blame] | 120 | serviceModule.factory('EventBusService', downgradeInjectable(EventBusService)); |
Michael Lando | a544510 | 2018-03-04 14:53:33 +0200 | [diff] [blame] | 121 | serviceModule.factory('DynamicComponentService', downgradeInjectable(DynamicComponentService)); |
ys9693 | 16a9fce | 2020-01-19 13:50:02 +0200 | [diff] [blame] | 122 | serviceModule.factory('HomeService', downgradeInjectable(HomeService)); |
| 123 | serviceModule.factory('CatalogService', downgradeInjectable(CatalogService)); |
Piotr Darosz | 2c25cba | 2019-03-27 15:25:50 +0100 | [diff] [blame] | 124 | serviceModule.factory('GabServiceNg2', downgradeInjectable(GabServiceNg2)); |
Michael Lando | 5b59349 | 2018-07-29 16:13:45 +0300 | [diff] [blame] | 125 | serviceModule.factory('AutomatedUpgradeService', downgradeInjectable(AutomatedUpgradeService)); |
miriame | 41ee9cb | 2019-03-04 13:49:15 +0200 | [diff] [blame] | 126 | serviceModule.factory('ToscaTypesServiceNg2', downgradeInjectable(ToscaTypesServiceNg2)); |
ys9693 | 16a9fce | 2020-01-19 13:50:02 +0200 | [diff] [blame] | 127 | serviceModule.factory('EventListenerService', downgradeInjectable(EventListenerService)); |
| 128 | serviceModule.factory('CompositionService', downgradeInjectable(CompositionService)); |
| 129 | serviceModule.factory('ReqAndCapabilitiesService', downgradeInjectable(ReqAndCapabilitiesService)); |
| 130 | serviceModule.factory('NodesFactory', downgradeInjectable(NodesFactory)); |
| 131 | serviceModule.service('OnboardingService', downgradeInjectable(OnboardingService)); |
vasraz | a6ae729 | 2021-03-21 20:48:30 +0000 | [diff] [blame] | 132 | serviceModule.service('ElementService', downgradeInjectable(ElementService)); |
aribeiro | 53df976 | 2021-06-16 23:21:04 +0100 | [diff] [blame] | 133 | serviceModule.service('ModelService', downgradeInjectable(ModelService)); |
ys9693 | 16a9fce | 2020-01-19 13:50:02 +0200 | [diff] [blame] | 134 | serviceModule.service('ImportVSPService', downgradeInjectable(ImportVSPService)); |
aribeiro | 1de1692 | 2021-10-01 11:30:49 +0100 | [diff] [blame] | 135 | serviceModule.service('ToscaArtifactService', downgradeInjectable(ToscaArtifactService)); |