blob: 7e664437a084b8761c6c41074af75574a6abc0b3 [file] [log] [blame]
Michael Landodd603392017-07-12 00:54:52 +03001/*-
2 * ============LICENSE_START=======================================================
3 * SDC
4 * ================================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
Piotr Darosz2c25cba2019-03-27 15:25:50 +01006 * Modifications Copyright (C) 2019 Nokia. All rights reserved.
Michael Landodd603392017-07-12 00:54:52 +03007 * ================================================================================
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
Idan Amit7363f3d2018-03-21 12:04:57 +020011 *
Michael Landodd603392017-07-12 00:54:52 +030012 * http://www.apache.org/licenses/LICENSE-2.0
Idan Amit7363f3d2018-03-21 12:04:57 +020013 *
Michael Landodd603392017-07-12 00:54:52 +030014 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
19 * ============LICENSE_END=========================================================
20 */
21
Michael Landoed64b5e2017-06-09 03:19:04 +030022import {ClickedOutsideDirective} from "../directives/clicked-outside/clicked-outside-directive";
23import {LoaderDirective} from "../directives/loader/loader-directive";
24import {UserHeaderDetailsDirective} from "../directives/user-header-details/user-header-details-directive";
25import {FileTypeDirective} from "../directives/file-type/file-type";
26import {DownloadArtifactDirective} from "../directives/download-artifact/download-artifact";
27import {EllipsisDirective} from "../directives/ellipsis/ellipsis-directive";
28import {InvalidCharactersDirective} from "../directives/invalid-characters/invalid-characters";
29import {ExpandCollapseDirective} from "../directives/utils/expand-collapse/expand-collapse";
30import {PerfectScrollerDirective} from "../directives/perfect-scrollbar/angular-perfect-scrollbar";
31import {SdcModalDirective} from "../directives/modal/sdc-modal";
32import {FileOpenerDirective} from "../directives/file-opener/file-opener";
33import {FileUploadDirective} from "../directives/file-upload/file-upload";
34import {StructureTreeDirective} from "../directives/structure-tree/structure-tree-directive";
35import {SmartTooltipDirective} from "../directives/utils/smart-tooltip/smart-tooltip";
Michael Landoed64b5e2017-06-09 03:19:04 +030036import {TagDirective} from "../directives/tag/tag-directive";
37import {SdcTagsDirective} from "../directives/utils/sdc-tags/sdc-tags";
38import {SdcKeyboardEventsDirective} from "../directives/utils/sdc-keyboard-events/sdc-keyboard-events";
39import {ExpandCollapseMenuBoxDirective} from "../directives/utils/expand-collapse-menu-box/expand-collaps-menu-box";
40import {PunchOutDirective} from "../directives/punch-out/punch-out";
41import {CustomValidationDirective} from "../directives/custom-validation/custom-validation";
42import {EcompHeaderDirective} from "../directives/ecomp-header/ecomp-header";
Michael Landoed64b5e2017-06-09 03:19:04 +030043import {EditNamePopoverDirective} from "../directives/edit-name-popover/edit-name-popover-directive";
44import {DataTypeFieldsStructureDirective} from "../directives/property-types/data-type-fields-structure/data-type-fields-structure";
45import {TypeMapDirective} from "../directives/property-types/type-map/type-map-directive";
46import {TypeListDirective} from "../directives/property-types/type-list/type-list-directive";
47import {SelectDataTypeFieldsStructureDirective} from "../directives/select-property-types/select-data-type-fields-structure/select-data-type-fields-structure";
48import {SelectTypeMapDirective} from "../directives/select-property-types/select-type-map/select-type-map-directive";
49import {SelectTypeListDirective} from "../directives/select-property-types/select-type-list/select-type-list-directive";
50import {ValidationOnLoadDirective} from "../directives/utils/validation-on-load/validation-on-load";
51import {InfoTooltipDirective} from "../directives/info-tooltip/info-tooltip";
52import {SdcTabsDirective} from "../directives/sdc-tabs/sdc-tabs-directive";
53import {SdcSingleTabDirective, InnerSdcSingleTabDirective} from "../directives/sdc-tabs/sdc-single-tab/sdc-single-tab-directive";
54import {ExpandCollapseListHeaderDirective} from "../directives/utils/expand-collapse-list-header/expand-collapse-list-header";
55import {JsonExportExcelDirective} from "../directives/export-json-to-excel/export-json-to-excel";
Michael Landoed64b5e2017-06-09 03:19:04 +030056import {TopProgressDirective} from "../directives/layout/top-progress/top-progress";
57import {CheckboxElementDirective} from "../directives/elements/checkbox/checkbox";
58import {RadiobuttonElementDirective} from "../directives/elements/radiobutton/radiobutton";
59import {OnLastRepeatDirective} from "../directives/events/on-last-repeat/on-last-repeat";
60import {InputRowDirective} from "../directives/inputs-and-properties/inputs/input-row-directive";
61import {PropertyRowDirective} from "../directives/inputs-and-properties/properties/property-row-directive";
62import {NodesFactory} from "../models/graph/nodes/nodes-factory";
63import {LinksFactory} from "../models/graph/graph-links/links-factory";
64import {ImageCreatorService} from "../directives/graphs-v2/image-creator/image-creator.service";
65import {Palette} from "../directives/graphs-v2/palette/palette.directive";
66import {CompositionGraph} from "../directives/graphs-v2/composition-graph/composition-graph.directive";
Michael Landoed64b5e2017-06-09 03:19:04 +030067import {DeploymentGraph} from "../directives/graphs-v2/deployment-graph/deployment-graph.directive";
68import {CommonGraphUtils} from "../directives/graphs-v2/common/common-graph-utils";
69import {CompositionGraphNodesUtils} from "../directives/graphs-v2/composition-graph/utils/composition-graph-nodes-utils";
70import {CompositionGraphGeneralUtils} from "../directives/graphs-v2/composition-graph/utils/composition-graph-general-utils";
71import {CompositionGraphLinkUtils} from "../directives/graphs-v2/composition-graph/utils/composition-graph-links-utils";
72import {DeploymentGraphGeneralUtils} from "../directives/graphs-v2/deployment-graph/deployment-utils/deployment-graph-general-utils";
73import {CompositionGraphPaletteUtils} from "../directives/graphs-v2/composition-graph/utils/composition-graph-palette-utils";
Michael Landoa5445102018-03-04 14:53:33 +020074import {CompositionGraphZoneUtils} from "../directives/graphs-v2/composition-graph/utils/composition-graph-zone-utils";
Michael Landoed64b5e2017-06-09 03:19:04 +030075import {MatchCapabilitiesRequirementsUtils} from "../directives/graphs-v2/composition-graph/utils/match-capability-requierment-utils";
Michael Landoed64b5e2017-06-09 03:19:04 +030076import {CapabilitiesListDirective} from "../directives/capabilities-and-requirements/capability/capabilities-list-directive";
77import {RequirementsListDirective} from "../directives/capabilities-and-requirements/requirement/requirements-list-directive";
Michael Landoa5445102018-03-04 14:53:33 +020078import {ServicePathGraphUtils} from "../directives/graphs-v2/composition-graph/utils/composition-graph-service-path-utils";
Michael Lando5b593492018-07-29 16:13:45 +030079import {PreventDoubleClickDirective} from "../directives/prevent-double-click/prevent-double-click";
Michael Landoed64b5e2017-06-09 03:19:04 +030080
81let moduleName:string = 'Sdc.Directives';
82let directiveModule:ng.IModule = angular.module(moduleName, []);
83
84directiveModule.directive('clickedOutside', ClickedOutsideDirective.factory);
85directiveModule.directive('loader', LoaderDirective.factory);
86directiveModule.directive('userHeaderDetails', UserHeaderDetailsDirective.factory);
87directiveModule.directive('ellipsis', EllipsisDirective.factory);
88directiveModule.directive('downloadArtifact', DownloadArtifactDirective.factory);
89directiveModule.directive('fileType', FileTypeDirective.factory);
90directiveModule.directive('invalidCharacters', InvalidCharactersDirective.factory);
91directiveModule.directive('perfectScrollbar', PerfectScrollerDirective.factory);
92directiveModule.directive('expandCollapse', ExpandCollapseDirective.factory);
Michael Lando5b593492018-07-29 16:13:45 +030093directiveModule.directive('ng1Modal', SdcModalDirective.factory);
Michael Landoed64b5e2017-06-09 03:19:04 +030094directiveModule.directive('fileOpener', FileOpenerDirective.factory);
95directiveModule.directive('fileUpload', FileUploadDirective.factory);
96directiveModule.directive('structureTree', StructureTreeDirective.factory);
97directiveModule.directive('sdcSmartTooltip', SmartTooltipDirective.factory);
Michael Landoed64b5e2017-06-09 03:19:04 +030098directiveModule.directive('sdcTag', TagDirective.factory);
99directiveModule.directive('sdcTags', SdcTagsDirective.factory);
100directiveModule.directive('sdcKeyboardEvents', SdcKeyboardEventsDirective.factory);
101directiveModule.directive('expandCollapseMenuBox', ExpandCollapseMenuBoxDirective.factory);
102directiveModule.directive('punchOut', PunchOutDirective.factory);
103directiveModule.directive('customValidation', CustomValidationDirective.factory);
104directiveModule.directive('ecompHeader', EcompHeaderDirective.factory);
Michael Landoed64b5e2017-06-09 03:19:04 +0300105directiveModule.directive('editNamePopover', EditNamePopoverDirective.factory);
106directiveModule.directive('fieldsStructure', DataTypeFieldsStructureDirective.factory);
107directiveModule.directive('typeMap', TypeMapDirective.factory);
108directiveModule.directive('typeList', TypeListDirective.factory);
109directiveModule.directive('selectFieldsStructure', SelectDataTypeFieldsStructureDirective.factory);
110directiveModule.directive('selectTypeMap', SelectTypeMapDirective.factory);
111directiveModule.directive('selectTypeList', SelectTypeListDirective.factory);
112directiveModule.directive('infoTooltip', InfoTooltipDirective.factory);
113directiveModule.directive('validationOnLoad', ValidationOnLoadDirective.factory);
Michael Lando5b593492018-07-29 16:13:45 +0300114directiveModule.directive('ng1Tabs', SdcTabsDirective.factory);
Michael Landoed64b5e2017-06-09 03:19:04 +0300115directiveModule.directive('sdcSingleTab', SdcSingleTabDirective.factory);
116directiveModule.directive('innerSdcSingleTab', InnerSdcSingleTabDirective.factory);
117directiveModule.directive('jsonExportExcel', JsonExportExcelDirective.factory);
118directiveModule.directive('expandCollapseListHeader', ExpandCollapseListHeaderDirective.factory);
Michael Lando5b593492018-07-29 16:13:45 +0300119directiveModule.directive('preventDoubleClick', PreventDoubleClickDirective.factory);
120//
Michael Landoed64b5e2017-06-09 03:19:04 +0300121//
122// // Layouts
Michael Landoed64b5e2017-06-09 03:19:04 +0300123directiveModule.directive('topProgress', TopProgressDirective.factory);
124//
125// // Elements
Michael Lando5b593492018-07-29 16:13:45 +0300126directiveModule.directive('ng1Checkbox', CheckboxElementDirective.factory);
Michael Landoed64b5e2017-06-09 03:19:04 +0300127directiveModule.directive('sdcRadioButton', RadiobuttonElementDirective.factory);
128//
129// // Events
130directiveModule.directive('onLastRepeat', OnLastRepeatDirective.factory);
131//
132// //Inputs & Properties
133directiveModule.directive('inputRow', InputRowDirective.factory);
134directiveModule.directive('propertyRow', PropertyRowDirective.factory);
135//
136//
137// // ------------------------------------------- Composition & Deployment Graphs------------------------------------------//
138//
139// //Util service for Graph
140directiveModule.service('NodesFactory', NodesFactory);
141directiveModule.service('LinksFactory', LinksFactory);
142directiveModule.service('ImageCreatorService', ImageCreatorService);
143//
144// //composition
145directiveModule.directive('palette', Palette.factory);
146directiveModule.directive('compositionGraph', CompositionGraph.factory);
Anjali walsatwar3527b3e2018-09-26 18:53:06 +0530147
Michael Landoed64b5e2017-06-09 03:19:04 +0300148//
149// //deployment
150directiveModule.directive('deploymentGraph', DeploymentGraph.factory);
151//
152// //Graph Utils - Common
153directiveModule.service('CommonGraphUtils', CommonGraphUtils);
154//
155// //Composition Graph Utils
156directiveModule.service('CompositionGraphNodesUtils', CompositionGraphNodesUtils);
157directiveModule.service('CompositionGraphGeneralUtils', CompositionGraphGeneralUtils);
158directiveModule.service('CompositionGraphLinkUtils', CompositionGraphLinkUtils);
159directiveModule.service('CompositionGraphPaletteUtils', CompositionGraphPaletteUtils);
Michael Landoa5445102018-03-04 14:53:33 +0200160directiveModule.service('CompositionGraphZoneUtils', CompositionGraphZoneUtils);
Michael Landoed64b5e2017-06-09 03:19:04 +0300161directiveModule.service('MatchCapabilitiesRequirementsUtils', MatchCapabilitiesRequirementsUtils);
Michael Landoa5445102018-03-04 14:53:33 +0200162directiveModule.service('ServicePathGraphUtils', ServicePathGraphUtils);
163
Michael Landoed64b5e2017-06-09 03:19:04 +0300164//
165// //Deployment Graph Utils
166directiveModule.service('DeploymentGraphGeneralUtils', DeploymentGraphGeneralUtils);
167
168
169//Compoisiton right tab directives
170directiveModule.directive('capabilitiesList', CapabilitiesListDirective.factory);
171directiveModule.directive('requirementsList', RequirementsListDirective.factory);
Tal Gitelman51d50f02017-12-10 18:55:03 +0200172
173
174// *** NG2 Components (downgraded) *** //
Michael Landoa5445102018-03-04 14:53:33 +0200175import { downgradeComponent } from "@angular/upgrade/static";
176import { MenuListNg2Component } from "../ng2/components/downgrade-wrappers/menu-list-ng2/menu-list-ng2.component";
177import { TopNavComponent } from "../ng2/components/layout/top-nav/top-nav.component";
178import { ZoneContainerComponent } from "../ng2/components/ui/canvas-zone/zone-container.component";
179import { ZoneInstanceComponent } from "../ng2/components/ui/canvas-zone/zone-instance/zone-instance.component";
Michael Lando5b593492018-07-29 16:13:45 +0300180import { CompositionPanelComponent } from 'app/ng2/pages/composition/panel/panel.component';
181import { CompositionPanelHeaderComponent } from 'app/ng2/pages/composition/panel/panel-header/panel-header.component';
Michael Landoa5445102018-03-04 14:53:33 +0200182import { PropertiesAssignmentComponent } from "../ng2/pages/properties-assignment/properties-assignment.page.component";
183import { SearchWithAutoCompleteComponent } from "../ng2/components/ui/search-with-autocomplete/search-with-autocomplete.component";
184import { PalettePopupPanelComponent } from "../ng2/components/ui/palette-popup-panel/palette-popup-panel.component";
185import { ServicePathComponent } from '../ng2/components/logic/service-path/service-path.component';
186import { ServicePathSelectorComponent } from '../ng2/components/logic/service-path-selector/service-path-selector.component';
ojasdubey4192e3c2019-03-18 14:15:03 +0530187import { ServiceConsumptionComponent } from '../ng2/components/logic/service-consumption/service-consumption.component';
miriamec2ce9142019-02-13 15:17:26 +0200188import { ServiceDependenciesComponent } from '../ng2/components/logic/service-dependencies/service-dependencies.component';
Michael Lando5b593492018-07-29 16:13:45 +0300189import { MultilineEllipsisComponent } from "../ng2/shared/multiline-ellipsis/multiline-ellipsis.component";
Arielk802bd2a2018-04-16 15:37:39 +0300190import { InterfaceOperationComponent } from '../ng2/pages/interface-operation/interface-operation.page.component';
191import { PluginFrameComponent } from "../ng2/components/ui/plugin/plugin-frame.component";
Michael Lando5b593492018-07-29 16:13:45 +0300192import { TileComponent } from "../ng2/components/ui/tile/tile.component";
Piotr Darosz2c25cba2019-03-27 15:25:50 +0100193import {GenericArtifactBrowserComponent} from "../ng2/components/logic/generic-artifact-browser/generic-artifact-browser.component";
Michael Lando5b593492018-07-29 16:13:45 +0300194
Tal Gitelman51d50f02017-12-10 18:55:03 +0200195
196directiveModule.directive('menuListNg2', downgradeComponent({
197 component: MenuListNg2Component,
198 inputs: ['props']
199}) as angular.IDirectiveFactory);
Michael Landoa5445102018-03-04 14:53:33 +0200200
Tal Gitelman51d50f02017-12-10 18:55:03 +0200201directiveModule.directive('topNav', downgradeComponent({
202 component: TopNavComponent,
Michael Lando5b593492018-07-29 16:13:45 +0300203 inputs: ['version', 'menuModel', 'topLvlSelectedIndex', 'hideSearch', 'searchTerm', 'notificationIconCallback', 'unsavedChanges', 'unsavedChangesCallback'],
Tal Gitelman51d50f02017-12-10 18:55:03 +0200204 outputs: ['searchTermChange']
205}) as ng.IDirectiveFactory);
Michael Landoa5445102018-03-04 14:53:33 +0200206
Piotr Darosz2c25cba2019-03-27 15:25:50 +0100207directiveModule.directive('gab', downgradeComponent({
208 component: GenericArtifactBrowserComponent,
209 inputs: ['pathsandnames', 'artifactid', 'resourceid'],
210 outputs: []
211}) as ng.IDirectiveFactory);
212
Michael Landoa5445102018-03-04 14:53:33 +0200213directiveModule.directive('ng2ZoneContainer', downgradeComponent({
214 component: ZoneContainerComponent,
Michael Lando5b593492018-07-29 16:13:45 +0300215 inputs: ['title', 'count', 'type', 'visible', 'minimized'],
216 outputs: ['minimize', 'backgroundClick']
Michael Landoa5445102018-03-04 14:53:33 +0200217}) as angular.IDirectiveFactory);
218
219directiveModule.directive('ng2ZoneInstance', downgradeComponent({
Michael Lando5b593492018-07-29 16:13:45 +0300220 component: ZoneInstanceComponent,
221 inputs: ['zoneInstance', 'isActive', 'activeInstanceMode', 'defaultIconText', 'isViewOnly', 'hidden', 'forceSave'],
222 outputs: ['modeChange', 'tagHandleClick', 'assignmentSaveStart', 'assignmentSaveComplete']
223}) as angular.IDirectiveFactory);
224
225directiveModule.directive('ng2CompositionPanel', downgradeComponent({
226 component: CompositionPanelComponent,
227 inputs: ['isViewOnly', 'isLoading', 'isCertified', 'selectedZoneInstanceId', 'selectedZoneInstanceType', 'selectedZoneInstanceName', 'topologyTemplate'],
Michael Landoa5445102018-03-04 14:53:33 +0200228}) as angular.IDirectiveFactory);
229
230directiveModule.directive('propertiesAssignment', downgradeComponent({
231 component: PropertiesAssignmentComponent
232}) as angular.IDirectiveFactory);
233
234directiveModule.directive('ng2SearchWithAutocomplete', downgradeComponent({
235 component: SearchWithAutoCompleteComponent,
236 inputs: ['searchPlaceholder', 'searchBarClass', 'autoCompleteValues'],
237 outputs: ['searchChanged', 'searchButtonClicked']
238}) as angular.IDirectiveFactory);
239
Michael Landoa5445102018-03-04 14:53:33 +0200240directiveModule.directive('ng2PalettePopupPanel', downgradeComponent({
241 component: PalettePopupPanelComponent,
242 inputs: [],
243 outputs: []
244}) as angular.IDirectiveFactory);
245
246directiveModule.directive('ng2ServicePath', downgradeComponent({
247 component: ServicePathComponent,
Michael Lando5b593492018-07-29 16:13:45 +0300248 inputs: ['onCreate', 'service', 'isViewOnly'],
Michael Landoa5445102018-03-04 14:53:33 +0200249 outputs: []
250}) as angular.IDirectiveFactory);
251
252directiveModule.directive('ng2ServicePathSelector', downgradeComponent({
253 component: ServicePathSelectorComponent,
254 inputs: ['drawPath', 'deletePaths', 'service', 'selectedPathId'],
255 outputs: []
256}) as angular.IDirectiveFactory);
Idan Amit7363f3d2018-03-21 12:04:57 +0200257
ojasdubey4192e3c2019-03-18 14:15:03 +0530258directiveModule.directive('ng2ServiceConsumption', downgradeComponent({
259 component: ServiceConsumptionComponent,
260 inputs: ['parentService', 'selectedService', 'selectedServiceInstanceId', 'instancesMappedList','parentServiceInputs', 'readonly'],
261 outputs: []
262}) as angular.IDirectiveFactory);
263
miriamec2ce9142019-02-13 15:17:26 +0200264directiveModule.directive('ng2ServiceDependencies', downgradeComponent({
265 component: ServiceDependenciesComponent,
266 inputs: ['compositeService', 'currentServiceInstance', 'selectedInstanceProperties', 'selectedInstanceSiblings', 'selectedInstanceConstraints', 'readonly'],
267 outputs: ['updateRulesListEvent', 'loadRulesListEvent','dependencyStatus']
268}) as angular.IDirectiveFactory);
269
Arielkaefe3912018-10-14 16:50:17 +0300270directiveModule.directive('interfaceOperation', downgradeComponent({
Arielk802bd2a2018-04-16 15:37:39 +0300271 component: InterfaceOperationComponent,
Arielkbce89862018-05-30 14:52:00 +0300272 inputs: ['component', 'readonly'],
Arielk802bd2a2018-04-16 15:37:39 +0300273 outputs: []
274}) as angular.IDirectiveFactory);
275
Michael Lando5b593492018-07-29 16:13:45 +0300276directiveModule.directive('ng2MultilineEllipsis', downgradeComponent({
277 component: MultilineEllipsisComponent,
278 inputs: ['lines', 'lineHeight', 'className'],
279 outputs: ['hasEllipsisChanged']
280}) as angular.IDirectiveFactory);
281
282directiveModule.directive('ng2UiTile', downgradeComponent({
283 component: TileComponent,
284 inputs: ['component'],
285 outputs: ['onTileClick']
286}) as angular.IDirectiveFactory);
287
Idan Amit7363f3d2018-03-21 12:04:57 +0200288directiveModule.directive('pluginFrame', downgradeComponent( {
289 component: PluginFrameComponent,
290 inputs: ['plugin', 'queryParams'],
291 outputs: ['onLoadingDone']
292}) as angular.IDirectiveFactory);