blob: 62854150565344ac133ea61eaa10908a7a588722 [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";
35import {PrintGraphScreenDirective} from "../directives/print-graph-screen/print-graph-screen";
36import {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";
67import {RelationMenuDirective} from "../directives/graphs-v2/relation-menu/relation-menu";
68import {DeploymentGraph} from "../directives/graphs-v2/deployment-graph/deployment-graph.directive";
69import {CommonGraphUtils} from "../directives/graphs-v2/common/common-graph-utils";
70import {CompositionGraphNodesUtils} from "../directives/graphs-v2/composition-graph/utils/composition-graph-nodes-utils";
71import {CompositionGraphGeneralUtils} from "../directives/graphs-v2/composition-graph/utils/composition-graph-general-utils";
72import {CompositionGraphLinkUtils} from "../directives/graphs-v2/composition-graph/utils/composition-graph-links-utils";
73import {DeploymentGraphGeneralUtils} from "../directives/graphs-v2/deployment-graph/deployment-utils/deployment-graph-general-utils";
74import {CompositionGraphPaletteUtils} from "../directives/graphs-v2/composition-graph/utils/composition-graph-palette-utils";
Michael Landoa5445102018-03-04 14:53:33 +020075import {CompositionGraphZoneUtils} from "../directives/graphs-v2/composition-graph/utils/composition-graph-zone-utils";
Michael Landoed64b5e2017-06-09 03:19:04 +030076import {MatchCapabilitiesRequirementsUtils} from "../directives/graphs-v2/composition-graph/utils/match-capability-requierment-utils";
Michael Landoed64b5e2017-06-09 03:19:04 +030077import {CapabilitiesListDirective} from "../directives/capabilities-and-requirements/capability/capabilities-list-directive";
78import {RequirementsListDirective} from "../directives/capabilities-and-requirements/requirement/requirements-list-directive";
Michael Landoa5445102018-03-04 14:53:33 +020079import {ServicePathGraphUtils} from "../directives/graphs-v2/composition-graph/utils/composition-graph-service-path-utils";
80import {PaletteAnimationComponent} from './../ng2/components/ui/palette-animation/palette-animation.component';
Michael Landoed64b5e2017-06-09 03:19:04 +030081
82let moduleName:string = 'Sdc.Directives';
83let directiveModule:ng.IModule = angular.module(moduleName, []);
84
85directiveModule.directive('clickedOutside', ClickedOutsideDirective.factory);
86directiveModule.directive('loader', LoaderDirective.factory);
87directiveModule.directive('userHeaderDetails', UserHeaderDetailsDirective.factory);
88directiveModule.directive('ellipsis', EllipsisDirective.factory);
89directiveModule.directive('downloadArtifact', DownloadArtifactDirective.factory);
90directiveModule.directive('fileType', FileTypeDirective.factory);
91directiveModule.directive('invalidCharacters', InvalidCharactersDirective.factory);
92directiveModule.directive('perfectScrollbar', PerfectScrollerDirective.factory);
93directiveModule.directive('expandCollapse', ExpandCollapseDirective.factory);
94directiveModule.directive('sdcModal', SdcModalDirective.factory);
95directiveModule.directive('fileOpener', FileOpenerDirective.factory);
96directiveModule.directive('fileUpload', FileUploadDirective.factory);
97directiveModule.directive('structureTree', StructureTreeDirective.factory);
98directiveModule.directive('sdcSmartTooltip', SmartTooltipDirective.factory);
99directiveModule.directive('printGraphScreen', PrintGraphScreenDirective.factory);
100directiveModule.directive('sdcTag', TagDirective.factory);
101directiveModule.directive('sdcTags', SdcTagsDirective.factory);
102directiveModule.directive('sdcKeyboardEvents', SdcKeyboardEventsDirective.factory);
103directiveModule.directive('expandCollapseMenuBox', ExpandCollapseMenuBoxDirective.factory);
104directiveModule.directive('punchOut', PunchOutDirective.factory);
105directiveModule.directive('customValidation', CustomValidationDirective.factory);
106directiveModule.directive('ecompHeader', EcompHeaderDirective.factory);
Michael Landoed64b5e2017-06-09 03:19:04 +0300107directiveModule.directive('editNamePopover', EditNamePopoverDirective.factory);
108directiveModule.directive('fieldsStructure', DataTypeFieldsStructureDirective.factory);
109directiveModule.directive('typeMap', TypeMapDirective.factory);
110directiveModule.directive('typeList', TypeListDirective.factory);
111directiveModule.directive('selectFieldsStructure', SelectDataTypeFieldsStructureDirective.factory);
112directiveModule.directive('selectTypeMap', SelectTypeMapDirective.factory);
113directiveModule.directive('selectTypeList', SelectTypeListDirective.factory);
114directiveModule.directive('infoTooltip', InfoTooltipDirective.factory);
115directiveModule.directive('validationOnLoad', ValidationOnLoadDirective.factory);
116directiveModule.directive('sdcTabs', SdcTabsDirective.factory);
117directiveModule.directive('sdcSingleTab', SdcSingleTabDirective.factory);
118directiveModule.directive('innerSdcSingleTab', InnerSdcSingleTabDirective.factory);
119directiveModule.directive('jsonExportExcel', JsonExportExcelDirective.factory);
120directiveModule.directive('expandCollapseListHeader', ExpandCollapseListHeaderDirective.factory);
121//
122// // Layouts
Michael Landoed64b5e2017-06-09 03:19:04 +0300123directiveModule.directive('topProgress', TopProgressDirective.factory);
124//
125// // Elements
126directiveModule.directive('sdcCheckbox', CheckboxElementDirective.factory);
127directiveModule.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);
147directiveModule.directive('relationMenu', RelationMenuDirective.factory);
148 //directiveModule.directive('assetPopover', AssetPopoverDirective.factory);
149//
150// //deployment
151directiveModule.directive('deploymentGraph', DeploymentGraph.factory);
152//
153// //Graph Utils - Common
154directiveModule.service('CommonGraphUtils', CommonGraphUtils);
155//
156// //Composition Graph Utils
157directiveModule.service('CompositionGraphNodesUtils', CompositionGraphNodesUtils);
158directiveModule.service('CompositionGraphGeneralUtils', CompositionGraphGeneralUtils);
159directiveModule.service('CompositionGraphLinkUtils', CompositionGraphLinkUtils);
160directiveModule.service('CompositionGraphPaletteUtils', CompositionGraphPaletteUtils);
Michael Landoa5445102018-03-04 14:53:33 +0200161directiveModule.service('CompositionGraphZoneUtils', CompositionGraphZoneUtils);
Michael Landoed64b5e2017-06-09 03:19:04 +0300162directiveModule.service('MatchCapabilitiesRequirementsUtils', MatchCapabilitiesRequirementsUtils);
Michael Landoa5445102018-03-04 14:53:33 +0200163directiveModule.service('ServicePathGraphUtils', ServicePathGraphUtils);
164
Michael Landoed64b5e2017-06-09 03:19:04 +0300165//
166// //Deployment Graph Utils
167directiveModule.service('DeploymentGraphGeneralUtils', DeploymentGraphGeneralUtils);
168
169
170//Compoisiton right tab directives
171directiveModule.directive('capabilitiesList', CapabilitiesListDirective.factory);
172directiveModule.directive('requirementsList', RequirementsListDirective.factory);
Tal Gitelman51d50f02017-12-10 18:55:03 +0200173
174
175// *** NG2 Components (downgraded) *** //
Michael Landoa5445102018-03-04 14:53:33 +0200176import { downgradeComponent } from "@angular/upgrade/static";
177import { MenuListNg2Component } from "../ng2/components/downgrade-wrappers/menu-list-ng2/menu-list-ng2.component";
178import { TopNavComponent } from "../ng2/components/layout/top-nav/top-nav.component";
179import { ZoneContainerComponent } from "../ng2/components/ui/canvas-zone/zone-container.component";
180import { ZoneInstanceComponent } from "../ng2/components/ui/canvas-zone/zone-instance/zone-instance.component";
181import { 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';
Idan Amit7363f3d2018-03-21 12:04:57 +0200186import {PluginFrameComponent} from "../ng2/components/ui/plugin/plugin-frame.component";
Tal Gitelman51d50f02017-12-10 18:55:03 +0200187
188directiveModule.directive('menuListNg2', downgradeComponent({
189 component: MenuListNg2Component,
190 inputs: ['props']
191}) as angular.IDirectiveFactory);
Michael Landoa5445102018-03-04 14:53:33 +0200192
Tal Gitelman51d50f02017-12-10 18:55:03 +0200193directiveModule.directive('topNav', downgradeComponent({
194 component: TopNavComponent,
195 inputs: ['version', 'menuModel', 'topLvlSelectedIndex', 'hideSearch', 'searchTerm', 'notificationIconCallback'],
196 outputs: ['searchTermChange']
197}) as ng.IDirectiveFactory);
Michael Landoa5445102018-03-04 14:53:33 +0200198
199directiveModule.directive('ng2ZoneContainer', downgradeComponent({
200 component: ZoneContainerComponent,
201 inputs: ['title', 'count', 'class', 'showZone', 'minifyZone'],
202 outputs: []
203}) as angular.IDirectiveFactory);
204
205directiveModule.directive('ng2ZoneInstance', downgradeComponent({
206 component: ZoneInstanceComponent,
207 inputs: ['config', 'isActive', 'activeInstanceMode', 'defaultIconText'],
208 outputs: ['modeChange']
209}) as angular.IDirectiveFactory);
210
211directiveModule.directive('propertiesAssignment', downgradeComponent({
212 component: PropertiesAssignmentComponent
213}) as angular.IDirectiveFactory);
214
215directiveModule.directive('ng2SearchWithAutocomplete', downgradeComponent({
216 component: SearchWithAutoCompleteComponent,
217 inputs: ['searchPlaceholder', 'searchBarClass', 'autoCompleteValues'],
218 outputs: ['searchChanged', 'searchButtonClicked']
219}) as angular.IDirectiveFactory);
220
221directiveModule.directive('ng2PaletteAnimation', downgradeComponent({
222 component: PaletteAnimationComponent,
223 inputs: ['from', 'to', 'icon' ],
224 outputs: []
225 }) as angular.IDirectiveFactory);
226
227directiveModule.directive('ng2PalettePopupPanel', downgradeComponent({
228 component: PalettePopupPanelComponent,
229 inputs: [],
230 outputs: []
231}) as angular.IDirectiveFactory);
232
233directiveModule.directive('ng2ServicePath', downgradeComponent({
234 component: ServicePathComponent,
235 inputs: ['onCreate', 'service'],
236 outputs: []
237}) as angular.IDirectiveFactory);
238
239directiveModule.directive('ng2ServicePathSelector', downgradeComponent({
240 component: ServicePathSelectorComponent,
241 inputs: ['drawPath', 'deletePaths', 'service', 'selectedPathId'],
242 outputs: []
243}) as angular.IDirectiveFactory);
Idan Amit7363f3d2018-03-21 12:04:57 +0200244
245directiveModule.directive('pluginFrame', downgradeComponent( {
246 component: PluginFrameComponent,
247 inputs: ['plugin', 'queryParams'],
248 outputs: ['onLoadingDone']
249}) as angular.IDirectiveFactory);