blob: e7acb1ccf693e3140e05fb7eede62f601dcfb167 [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.
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
Idan Amit7363f3d2018-03-21 12:04:57 +020010 *
Michael Landodd603392017-07-12 00:54:52 +030011 * http://www.apache.org/licenses/LICENSE-2.0
Idan Amit7363f3d2018-03-21 12:04:57 +020012 *
Michael Landodd603392017-07-12 00:54:52 +030013 * 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 Landoed64b5e2017-06-09 03:19:04 +030021import {ClickedOutsideDirective} from "../directives/clicked-outside/clicked-outside-directive";
22import {LoaderDirective} from "../directives/loader/loader-directive";
23import {UserHeaderDetailsDirective} from "../directives/user-header-details/user-header-details-directive";
24import {FileTypeDirective} from "../directives/file-type/file-type";
25import {DownloadArtifactDirective} from "../directives/download-artifact/download-artifact";
26import {EllipsisDirective} from "../directives/ellipsis/ellipsis-directive";
27import {InvalidCharactersDirective} from "../directives/invalid-characters/invalid-characters";
28import {ExpandCollapseDirective} from "../directives/utils/expand-collapse/expand-collapse";
29import {PerfectScrollerDirective} from "../directives/perfect-scrollbar/angular-perfect-scrollbar";
30import {SdcModalDirective} from "../directives/modal/sdc-modal";
31import {FileOpenerDirective} from "../directives/file-opener/file-opener";
32import {FileUploadDirective} from "../directives/file-upload/file-upload";
33import {StructureTreeDirective} from "../directives/structure-tree/structure-tree-directive";
34import {SmartTooltipDirective} from "../directives/utils/smart-tooltip/smart-tooltip";
Michael Landoed64b5e2017-06-09 03:19:04 +030035import {TagDirective} from "../directives/tag/tag-directive";
36import {SdcTagsDirective} from "../directives/utils/sdc-tags/sdc-tags";
37import {SdcKeyboardEventsDirective} from "../directives/utils/sdc-keyboard-events/sdc-keyboard-events";
38import {ExpandCollapseMenuBoxDirective} from "../directives/utils/expand-collapse-menu-box/expand-collaps-menu-box";
39import {PunchOutDirective} from "../directives/punch-out/punch-out";
40import {CustomValidationDirective} from "../directives/custom-validation/custom-validation";
41import {EcompHeaderDirective} from "../directives/ecomp-header/ecomp-header";
Michael Landoed64b5e2017-06-09 03:19:04 +030042import {EditNamePopoverDirective} from "../directives/edit-name-popover/edit-name-popover-directive";
43import {DataTypeFieldsStructureDirective} from "../directives/property-types/data-type-fields-structure/data-type-fields-structure";
44import {TypeMapDirective} from "../directives/property-types/type-map/type-map-directive";
45import {TypeListDirective} from "../directives/property-types/type-list/type-list-directive";
46import {SelectDataTypeFieldsStructureDirective} from "../directives/select-property-types/select-data-type-fields-structure/select-data-type-fields-structure";
47import {SelectTypeMapDirective} from "../directives/select-property-types/select-type-map/select-type-map-directive";
48import {SelectTypeListDirective} from "../directives/select-property-types/select-type-list/select-type-list-directive";
49import {ValidationOnLoadDirective} from "../directives/utils/validation-on-load/validation-on-load";
50import {InfoTooltipDirective} from "../directives/info-tooltip/info-tooltip";
51import {SdcTabsDirective} from "../directives/sdc-tabs/sdc-tabs-directive";
52import {SdcSingleTabDirective, InnerSdcSingleTabDirective} from "../directives/sdc-tabs/sdc-single-tab/sdc-single-tab-directive";
53import {ExpandCollapseListHeaderDirective} from "../directives/utils/expand-collapse-list-header/expand-collapse-list-header";
54import {JsonExportExcelDirective} from "../directives/export-json-to-excel/export-json-to-excel";
Michael Landoed64b5e2017-06-09 03:19:04 +030055import {TopProgressDirective} from "../directives/layout/top-progress/top-progress";
56import {CheckboxElementDirective} from "../directives/elements/checkbox/checkbox";
57import {RadiobuttonElementDirective} from "../directives/elements/radiobutton/radiobutton";
58import {OnLastRepeatDirective} from "../directives/events/on-last-repeat/on-last-repeat";
59import {InputRowDirective} from "../directives/inputs-and-properties/inputs/input-row-directive";
60import {PropertyRowDirective} from "../directives/inputs-and-properties/properties/property-row-directive";
61import {NodesFactory} from "../models/graph/nodes/nodes-factory";
62import {LinksFactory} from "../models/graph/graph-links/links-factory";
63import {ImageCreatorService} from "../directives/graphs-v2/image-creator/image-creator.service";
64import {Palette} from "../directives/graphs-v2/palette/palette.directive";
65import {CompositionGraph} from "../directives/graphs-v2/composition-graph/composition-graph.directive";
Michael Landoed64b5e2017-06-09 03:19:04 +030066import {DeploymentGraph} from "../directives/graphs-v2/deployment-graph/deployment-graph.directive";
67import {CommonGraphUtils} from "../directives/graphs-v2/common/common-graph-utils";
68import {CompositionGraphNodesUtils} from "../directives/graphs-v2/composition-graph/utils/composition-graph-nodes-utils";
69import {CompositionGraphGeneralUtils} from "../directives/graphs-v2/composition-graph/utils/composition-graph-general-utils";
70import {CompositionGraphLinkUtils} from "../directives/graphs-v2/composition-graph/utils/composition-graph-links-utils";
71import {DeploymentGraphGeneralUtils} from "../directives/graphs-v2/deployment-graph/deployment-utils/deployment-graph-general-utils";
72import {CompositionGraphPaletteUtils} from "../directives/graphs-v2/composition-graph/utils/composition-graph-palette-utils";
Michael Landoa5445102018-03-04 14:53:33 +020073import {CompositionGraphZoneUtils} from "../directives/graphs-v2/composition-graph/utils/composition-graph-zone-utils";
Michael Landoed64b5e2017-06-09 03:19:04 +030074import {MatchCapabilitiesRequirementsUtils} from "../directives/graphs-v2/composition-graph/utils/match-capability-requierment-utils";
Michael Landoed64b5e2017-06-09 03:19:04 +030075import {CapabilitiesListDirective} from "../directives/capabilities-and-requirements/capability/capabilities-list-directive";
76import {RequirementsListDirective} from "../directives/capabilities-and-requirements/requirement/requirements-list-directive";
Michael Landoa5445102018-03-04 14:53:33 +020077import {ServicePathGraphUtils} from "../directives/graphs-v2/composition-graph/utils/composition-graph-service-path-utils";
Michael Lando5b593492018-07-29 16:13:45 +030078import {PreventDoubleClickDirective} from "../directives/prevent-double-click/prevent-double-click";
Michael Landoed64b5e2017-06-09 03:19:04 +030079
80let moduleName:string = 'Sdc.Directives';
81let directiveModule:ng.IModule = angular.module(moduleName, []);
82
83directiveModule.directive('clickedOutside', ClickedOutsideDirective.factory);
84directiveModule.directive('loader', LoaderDirective.factory);
85directiveModule.directive('userHeaderDetails', UserHeaderDetailsDirective.factory);
86directiveModule.directive('ellipsis', EllipsisDirective.factory);
87directiveModule.directive('downloadArtifact', DownloadArtifactDirective.factory);
88directiveModule.directive('fileType', FileTypeDirective.factory);
89directiveModule.directive('invalidCharacters', InvalidCharactersDirective.factory);
90directiveModule.directive('perfectScrollbar', PerfectScrollerDirective.factory);
91directiveModule.directive('expandCollapse', ExpandCollapseDirective.factory);
Michael Lando5b593492018-07-29 16:13:45 +030092directiveModule.directive('ng1Modal', SdcModalDirective.factory);
Michael Landoed64b5e2017-06-09 03:19:04 +030093directiveModule.directive('fileOpener', FileOpenerDirective.factory);
94directiveModule.directive('fileUpload', FileUploadDirective.factory);
95directiveModule.directive('structureTree', StructureTreeDirective.factory);
96directiveModule.directive('sdcSmartTooltip', SmartTooltipDirective.factory);
Michael Landoed64b5e2017-06-09 03:19:04 +030097directiveModule.directive('sdcTag', TagDirective.factory);
98directiveModule.directive('sdcTags', SdcTagsDirective.factory);
99directiveModule.directive('sdcKeyboardEvents', SdcKeyboardEventsDirective.factory);
100directiveModule.directive('expandCollapseMenuBox', ExpandCollapseMenuBoxDirective.factory);
101directiveModule.directive('punchOut', PunchOutDirective.factory);
102directiveModule.directive('customValidation', CustomValidationDirective.factory);
103directiveModule.directive('ecompHeader', EcompHeaderDirective.factory);
Michael Landoed64b5e2017-06-09 03:19:04 +0300104directiveModule.directive('editNamePopover', EditNamePopoverDirective.factory);
105directiveModule.directive('fieldsStructure', DataTypeFieldsStructureDirective.factory);
106directiveModule.directive('typeMap', TypeMapDirective.factory);
107directiveModule.directive('typeList', TypeListDirective.factory);
108directiveModule.directive('selectFieldsStructure', SelectDataTypeFieldsStructureDirective.factory);
109directiveModule.directive('selectTypeMap', SelectTypeMapDirective.factory);
110directiveModule.directive('selectTypeList', SelectTypeListDirective.factory);
111directiveModule.directive('infoTooltip', InfoTooltipDirective.factory);
112directiveModule.directive('validationOnLoad', ValidationOnLoadDirective.factory);
Michael Lando5b593492018-07-29 16:13:45 +0300113directiveModule.directive('ng1Tabs', SdcTabsDirective.factory);
Michael Landoed64b5e2017-06-09 03:19:04 +0300114directiveModule.directive('sdcSingleTab', SdcSingleTabDirective.factory);
115directiveModule.directive('innerSdcSingleTab', InnerSdcSingleTabDirective.factory);
116directiveModule.directive('jsonExportExcel', JsonExportExcelDirective.factory);
117directiveModule.directive('expandCollapseListHeader', ExpandCollapseListHeaderDirective.factory);
Michael Lando5b593492018-07-29 16:13:45 +0300118directiveModule.directive('preventDoubleClick', PreventDoubleClickDirective.factory);
119//
Michael Landoed64b5e2017-06-09 03:19:04 +0300120//
121// // Layouts
Michael Landoed64b5e2017-06-09 03:19:04 +0300122directiveModule.directive('topProgress', TopProgressDirective.factory);
123//
124// // Elements
Michael Lando5b593492018-07-29 16:13:45 +0300125directiveModule.directive('ng1Checkbox', CheckboxElementDirective.factory);
Michael Landoed64b5e2017-06-09 03:19:04 +0300126directiveModule.directive('sdcRadioButton', RadiobuttonElementDirective.factory);
127//
128// // Events
129directiveModule.directive('onLastRepeat', OnLastRepeatDirective.factory);
130//
131// //Inputs & Properties
132directiveModule.directive('inputRow', InputRowDirective.factory);
133directiveModule.directive('propertyRow', PropertyRowDirective.factory);
134//
135//
136// // ------------------------------------------- Composition & Deployment Graphs------------------------------------------//
137//
138// //Util service for Graph
139directiveModule.service('NodesFactory', NodesFactory);
140directiveModule.service('LinksFactory', LinksFactory);
141directiveModule.service('ImageCreatorService', ImageCreatorService);
142//
143// //composition
144directiveModule.directive('palette', Palette.factory);
145directiveModule.directive('compositionGraph', CompositionGraph.factory);
Anjali walsatwar3527b3e2018-09-26 18:53:06 +0530146
Michael Landoed64b5e2017-06-09 03:19:04 +0300147//
148// //deployment
149directiveModule.directive('deploymentGraph', DeploymentGraph.factory);
150//
151// //Graph Utils - Common
152directiveModule.service('CommonGraphUtils', CommonGraphUtils);
153//
154// //Composition Graph Utils
155directiveModule.service('CompositionGraphNodesUtils', CompositionGraphNodesUtils);
156directiveModule.service('CompositionGraphGeneralUtils', CompositionGraphGeneralUtils);
157directiveModule.service('CompositionGraphLinkUtils', CompositionGraphLinkUtils);
158directiveModule.service('CompositionGraphPaletteUtils', CompositionGraphPaletteUtils);
Michael Landoa5445102018-03-04 14:53:33 +0200159directiveModule.service('CompositionGraphZoneUtils', CompositionGraphZoneUtils);
Michael Landoed64b5e2017-06-09 03:19:04 +0300160directiveModule.service('MatchCapabilitiesRequirementsUtils', MatchCapabilitiesRequirementsUtils);
Michael Landoa5445102018-03-04 14:53:33 +0200161directiveModule.service('ServicePathGraphUtils', ServicePathGraphUtils);
162
Michael Landoed64b5e2017-06-09 03:19:04 +0300163//
164// //Deployment Graph Utils
165directiveModule.service('DeploymentGraphGeneralUtils', DeploymentGraphGeneralUtils);
166
167
168//Compoisiton right tab directives
169directiveModule.directive('capabilitiesList', CapabilitiesListDirective.factory);
170directiveModule.directive('requirementsList', RequirementsListDirective.factory);
Tal Gitelman51d50f02017-12-10 18:55:03 +0200171
172
173// *** NG2 Components (downgraded) *** //
Michael Landoa5445102018-03-04 14:53:33 +0200174import { downgradeComponent } from "@angular/upgrade/static";
175import { MenuListNg2Component } from "../ng2/components/downgrade-wrappers/menu-list-ng2/menu-list-ng2.component";
176import { TopNavComponent } from "../ng2/components/layout/top-nav/top-nav.component";
177import { ZoneContainerComponent } from "../ng2/components/ui/canvas-zone/zone-container.component";
178import { ZoneInstanceComponent } from "../ng2/components/ui/canvas-zone/zone-instance/zone-instance.component";
Michael Lando5b593492018-07-29 16:13:45 +0300179import { CompositionPanelComponent } from 'app/ng2/pages/composition/panel/panel.component';
180import { CompositionPanelHeaderComponent } from 'app/ng2/pages/composition/panel/panel-header/panel-header.component';
Michael Landoa5445102018-03-04 14:53:33 +0200181import { PropertiesAssignmentComponent } from "../ng2/pages/properties-assignment/properties-assignment.page.component";
182import { SearchWithAutoCompleteComponent } from "../ng2/components/ui/search-with-autocomplete/search-with-autocomplete.component";
183import { PalettePopupPanelComponent } from "../ng2/components/ui/palette-popup-panel/palette-popup-panel.component";
184import { ServicePathComponent } from '../ng2/components/logic/service-path/service-path.component';
185import { ServicePathSelectorComponent } from '../ng2/components/logic/service-path-selector/service-path-selector.component';
Michael Lando5b593492018-07-29 16:13:45 +0300186import { MultilineEllipsisComponent } from "../ng2/shared/multiline-ellipsis/multiline-ellipsis.component";
Arielk802bd2a2018-04-16 15:37:39 +0300187import { InterfaceOperationComponent } from '../ng2/pages/interface-operation/interface-operation.page.component';
188import { PluginFrameComponent } from "../ng2/components/ui/plugin/plugin-frame.component";
Michael Lando5b593492018-07-29 16:13:45 +0300189import { TileComponent } from "../ng2/components/ui/tile/tile.component";
190
Tal Gitelman51d50f02017-12-10 18:55:03 +0200191
192directiveModule.directive('menuListNg2', downgradeComponent({
193 component: MenuListNg2Component,
194 inputs: ['props']
195}) as angular.IDirectiveFactory);
Michael Landoa5445102018-03-04 14:53:33 +0200196
Tal Gitelman51d50f02017-12-10 18:55:03 +0200197directiveModule.directive('topNav', downgradeComponent({
198 component: TopNavComponent,
Michael Lando5b593492018-07-29 16:13:45 +0300199 inputs: ['version', 'menuModel', 'topLvlSelectedIndex', 'hideSearch', 'searchTerm', 'notificationIconCallback', 'unsavedChanges', 'unsavedChangesCallback'],
Tal Gitelman51d50f02017-12-10 18:55:03 +0200200 outputs: ['searchTermChange']
201}) as ng.IDirectiveFactory);
Michael Landoa5445102018-03-04 14:53:33 +0200202
203directiveModule.directive('ng2ZoneContainer', downgradeComponent({
204 component: ZoneContainerComponent,
Michael Lando5b593492018-07-29 16:13:45 +0300205 inputs: ['title', 'count', 'type', 'visible', 'minimized'],
206 outputs: ['minimize', 'backgroundClick']
Michael Landoa5445102018-03-04 14:53:33 +0200207}) as angular.IDirectiveFactory);
208
209directiveModule.directive('ng2ZoneInstance', downgradeComponent({
Michael Lando5b593492018-07-29 16:13:45 +0300210 component: ZoneInstanceComponent,
211 inputs: ['zoneInstance', 'isActive', 'activeInstanceMode', 'defaultIconText', 'isViewOnly', 'hidden', 'forceSave'],
212 outputs: ['modeChange', 'tagHandleClick', 'assignmentSaveStart', 'assignmentSaveComplete']
213}) as angular.IDirectiveFactory);
214
215directiveModule.directive('ng2CompositionPanel', downgradeComponent({
216 component: CompositionPanelComponent,
217 inputs: ['isViewOnly', 'isLoading', 'isCertified', 'selectedZoneInstanceId', 'selectedZoneInstanceType', 'selectedZoneInstanceName', 'topologyTemplate'],
Michael Landoa5445102018-03-04 14:53:33 +0200218}) as angular.IDirectiveFactory);
219
220directiveModule.directive('propertiesAssignment', downgradeComponent({
221 component: PropertiesAssignmentComponent
222}) as angular.IDirectiveFactory);
223
224directiveModule.directive('ng2SearchWithAutocomplete', downgradeComponent({
225 component: SearchWithAutoCompleteComponent,
226 inputs: ['searchPlaceholder', 'searchBarClass', 'autoCompleteValues'],
227 outputs: ['searchChanged', 'searchButtonClicked']
228}) as angular.IDirectiveFactory);
229
Michael Landoa5445102018-03-04 14:53:33 +0200230directiveModule.directive('ng2PalettePopupPanel', downgradeComponent({
231 component: PalettePopupPanelComponent,
232 inputs: [],
233 outputs: []
234}) as angular.IDirectiveFactory);
235
236directiveModule.directive('ng2ServicePath', downgradeComponent({
237 component: ServicePathComponent,
Michael Lando5b593492018-07-29 16:13:45 +0300238 inputs: ['onCreate', 'service', 'isViewOnly'],
Michael Landoa5445102018-03-04 14:53:33 +0200239 outputs: []
240}) as angular.IDirectiveFactory);
241
242directiveModule.directive('ng2ServicePathSelector', downgradeComponent({
243 component: ServicePathSelectorComponent,
244 inputs: ['drawPath', 'deletePaths', 'service', 'selectedPathId'],
245 outputs: []
246}) as angular.IDirectiveFactory);
Idan Amit7363f3d2018-03-21 12:04:57 +0200247
Arielk802bd2a2018-04-16 15:37:39 +0300248directiveModule.directive('ng2InterfaceOperation', downgradeComponent({
249 component: InterfaceOperationComponent,
Arielkbce89862018-05-30 14:52:00 +0300250 inputs: ['component', 'readonly'],
Arielk802bd2a2018-04-16 15:37:39 +0300251 outputs: []
252}) as angular.IDirectiveFactory);
253
Michael Lando5b593492018-07-29 16:13:45 +0300254directiveModule.directive('ng2MultilineEllipsis', downgradeComponent({
255 component: MultilineEllipsisComponent,
256 inputs: ['lines', 'lineHeight', 'className'],
257 outputs: ['hasEllipsisChanged']
258}) as angular.IDirectiveFactory);
259
260directiveModule.directive('ng2UiTile', downgradeComponent({
261 component: TileComponent,
262 inputs: ['component'],
263 outputs: ['onTileClick']
264}) as angular.IDirectiveFactory);
265
Idan Amit7363f3d2018-03-21 12:04:57 +0200266directiveModule.directive('pluginFrame', downgradeComponent( {
267 component: PluginFrameComponent,
268 inputs: ['plugin', 'queryParams'],
269 outputs: ['onLoadingDone']
270}) as angular.IDirectiveFactory);