blob: 270a764e869b29bdfb6d73717799de976e0eec39 [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";
ys969316a9fce2020-01-19 13:50:02 +020052import {
vasraz26e50292021-02-16 17:37:57 +000053 InnerSdcSingleTabDirective,
54 SdcSingleTabDirective
ys969316a9fce2020-01-19 13:50:02 +020055} from "../directives/sdc-tabs/sdc-single-tab/sdc-single-tab-directive";
Michael Landoed64b5e2017-06-09 03:19:04 +030056import {ExpandCollapseListHeaderDirective} from "../directives/utils/expand-collapse-list-header/expand-collapse-list-header";
57import {JsonExportExcelDirective} from "../directives/export-json-to-excel/export-json-to-excel";
Michael Landoed64b5e2017-06-09 03:19:04 +030058import {TopProgressDirective} from "../directives/layout/top-progress/top-progress";
59import {CheckboxElementDirective} from "../directives/elements/checkbox/checkbox";
60import {RadiobuttonElementDirective} from "../directives/elements/radiobutton/radiobutton";
61import {OnLastRepeatDirective} from "../directives/events/on-last-repeat/on-last-repeat";
62import {InputRowDirective} from "../directives/inputs-and-properties/inputs/input-row-directive";
63import {PropertyRowDirective} from "../directives/inputs-and-properties/properties/property-row-directive";
64import {NodesFactory} from "../models/graph/nodes/nodes-factory";
65import {LinksFactory} from "../models/graph/graph-links/links-factory";
Michael Landoed64b5e2017-06-09 03:19:04 +030066import {CapabilitiesListDirective} from "../directives/capabilities-and-requirements/capability/capabilities-list-directive";
67import {RequirementsListDirective} from "../directives/capabilities-and-requirements/requirement/requirements-list-directive";
Michael Lando5b593492018-07-29 16:13:45 +030068import {PreventDoubleClickDirective} from "../directives/prevent-double-click/prevent-double-click";
vasraz26e50292021-02-16 17:37:57 +000069// *** NG2 Components (downgraded) *** //
70import {downgradeComponent} from "@angular/upgrade/static";
71import {MenuListNg2Component} from "../ng2/components/downgrade-wrappers/menu-list-ng2/menu-list-ng2.component";
72import {TopNavComponent} from "../ng2/components/layout/top-nav/top-nav.component";
73import {ZoneContainerComponent} from "../ng2/pages/composition/graph/canvas-zone/zone-container.component";
74import {ZoneInstanceComponent} from "../ng2/pages/composition/graph/canvas-zone/zone-instance/zone-instance.component";
75import {CompositionPanelComponent} from 'app/ng2/pages/composition/panel/composition-panel.component';
76import {PropertiesAssignmentComponent} from "../ng2/pages/properties-assignment/properties-assignment.page.component";
77import {SearchWithAutoCompleteComponent} from "../ng2/components/ui/search-with-autocomplete/search-with-autocomplete.component";
78import {PalettePopupPanelComponent} from "../ng2/pages/composition/palette/palette-popup-panel/palette-popup-panel.component";
79import {ServicePathSelectorComponent} from '../ng2/pages/composition/graph/service-path-selector/service-path-selector.component';
80import {MultilineEllipsisComponent} from "../ng2/shared/multiline-ellipsis/multiline-ellipsis.component";
81import {InterfaceOperationComponent} from '../ng2/pages/interface-operation/interface-operation.page.component';
82import {PluginFrameComponent} from "../ng2/components/ui/plugin/plugin-frame.component";
83import {TileComponent} from "../ng2/components/ui/tile/tile.component";
84import {CompositionPageComponent} from "../ng2/pages/composition/composition-page.component";
85import {CatalogComponent} from "../ng2/pages/catalog/catalog.component";
86import {HomeComponent} from "../ng2/pages/home/home.component";
87import {PluginContextViewPageComponent} from "../ng2/pages/plugins/plugin-context-view/plugin-context-view.page.component";
88import {PluginTabViewPageComponent} from "../ng2/pages/plugins/plugin-tab-view/plugin-tab-view.page.component";
89import {CompositionGraphComponent} from "../ng2/pages/composition/graph/composition-graph.component";
90import {DeploymentPageComponent} from "../ng2/pages/workspace/deployment/deployment-page.component";
91import {ActivityLogComponent} from "../ng2/pages/workspace/activity-log/activity-log.component";
92import {ToscaArtifactPageComponent} from "../ng2/pages/workspace/tosca-artifacts/tosca-artifact-page.component";
93import {InformationArtifactPageComponent} from "../ng2/pages/workspace/information-artifact/information-artifact-page.component";
94import {AttributesComponent} from "../view-models/workspace/tabs/attributes/attributes.component";
95import {DeploymentArtifactsPageComponent} from "../ng2/pages/workspace/deployment-artifacts/deployment-artifacts-page.component";
96import {ReqAndCapabilitiesComponent} from "../ng2/pages/workspace/req-and-capabilities/req-and-capabilities.component";
97import {DistributionComponent} from '../ng2/pages/workspace/disribution/distribution.component';
98import {AttributesOutputsComponent} from "../ng2/pages/attributes-outputs/attributes-outputs.page.component";
Michael Landoed64b5e2017-06-09 03:19:04 +030099
vasraz26e50292021-02-16 17:37:57 +0000100let moduleName: string = 'Sdc.Directives';
101let directiveModule: ng.IModule = angular.module(moduleName, []);
Michael Landoed64b5e2017-06-09 03:19:04 +0300102
103directiveModule.directive('clickedOutside', ClickedOutsideDirective.factory);
104directiveModule.directive('loader', LoaderDirective.factory);
105directiveModule.directive('userHeaderDetails', UserHeaderDetailsDirective.factory);
106directiveModule.directive('ellipsis', EllipsisDirective.factory);
107directiveModule.directive('downloadArtifact', DownloadArtifactDirective.factory);
108directiveModule.directive('fileType', FileTypeDirective.factory);
109directiveModule.directive('invalidCharacters', InvalidCharactersDirective.factory);
110directiveModule.directive('perfectScrollbar', PerfectScrollerDirective.factory);
111directiveModule.directive('expandCollapse', ExpandCollapseDirective.factory);
Michael Lando5b593492018-07-29 16:13:45 +0300112directiveModule.directive('ng1Modal', SdcModalDirective.factory);
Michael Landoed64b5e2017-06-09 03:19:04 +0300113directiveModule.directive('fileOpener', FileOpenerDirective.factory);
114directiveModule.directive('fileUpload', FileUploadDirective.factory);
115directiveModule.directive('structureTree', StructureTreeDirective.factory);
116directiveModule.directive('sdcSmartTooltip', SmartTooltipDirective.factory);
Michael Landoed64b5e2017-06-09 03:19:04 +0300117directiveModule.directive('sdcTag', TagDirective.factory);
118directiveModule.directive('sdcTags', SdcTagsDirective.factory);
119directiveModule.directive('sdcKeyboardEvents', SdcKeyboardEventsDirective.factory);
120directiveModule.directive('expandCollapseMenuBox', ExpandCollapseMenuBoxDirective.factory);
121directiveModule.directive('punchOut', PunchOutDirective.factory);
122directiveModule.directive('customValidation', CustomValidationDirective.factory);
123directiveModule.directive('ecompHeader', EcompHeaderDirective.factory);
Michael Landoed64b5e2017-06-09 03:19:04 +0300124directiveModule.directive('editNamePopover', EditNamePopoverDirective.factory);
125directiveModule.directive('fieldsStructure', DataTypeFieldsStructureDirective.factory);
126directiveModule.directive('typeMap', TypeMapDirective.factory);
127directiveModule.directive('typeList', TypeListDirective.factory);
128directiveModule.directive('selectFieldsStructure', SelectDataTypeFieldsStructureDirective.factory);
129directiveModule.directive('selectTypeMap', SelectTypeMapDirective.factory);
130directiveModule.directive('selectTypeList', SelectTypeListDirective.factory);
131directiveModule.directive('infoTooltip', InfoTooltipDirective.factory);
132directiveModule.directive('validationOnLoad', ValidationOnLoadDirective.factory);
Michael Lando5b593492018-07-29 16:13:45 +0300133directiveModule.directive('ng1Tabs', SdcTabsDirective.factory);
Michael Landoed64b5e2017-06-09 03:19:04 +0300134directiveModule.directive('sdcSingleTab', SdcSingleTabDirective.factory);
135directiveModule.directive('innerSdcSingleTab', InnerSdcSingleTabDirective.factory);
136directiveModule.directive('jsonExportExcel', JsonExportExcelDirective.factory);
137directiveModule.directive('expandCollapseListHeader', ExpandCollapseListHeaderDirective.factory);
Michael Lando5b593492018-07-29 16:13:45 +0300138directiveModule.directive('preventDoubleClick', PreventDoubleClickDirective.factory);
139//
Michael Landoed64b5e2017-06-09 03:19:04 +0300140//
141// // Layouts
Michael Landoed64b5e2017-06-09 03:19:04 +0300142directiveModule.directive('topProgress', TopProgressDirective.factory);
143//
144// // Elements
Michael Lando5b593492018-07-29 16:13:45 +0300145directiveModule.directive('ng1Checkbox', CheckboxElementDirective.factory);
Michael Landoed64b5e2017-06-09 03:19:04 +0300146directiveModule.directive('sdcRadioButton', RadiobuttonElementDirective.factory);
147//
148// // Events
149directiveModule.directive('onLastRepeat', OnLastRepeatDirective.factory);
150//
151// //Inputs & Properties
152directiveModule.directive('inputRow', InputRowDirective.factory);
153directiveModule.directive('propertyRow', PropertyRowDirective.factory);
154//
155//
156// // ------------------------------------------- Composition & Deployment Graphs------------------------------------------//
157//
158// //Util service for Graph
159directiveModule.service('NodesFactory', NodesFactory);
160directiveModule.service('LinksFactory', LinksFactory);
Michael Landoed64b5e2017-06-09 03:19:04 +0300161
162
163//Compoisiton right tab directives
164directiveModule.directive('capabilitiesList', CapabilitiesListDirective.factory);
165directiveModule.directive('requirementsList', RequirementsListDirective.factory);
Tal Gitelman51d50f02017-12-10 18:55:03 +0200166
167
Tal Gitelman51d50f02017-12-10 18:55:03 +0200168directiveModule.directive('menuListNg2', downgradeComponent({
vasraz26e50292021-02-16 17:37:57 +0000169 component: MenuListNg2Component,
170 inputs: ['props']
Tal Gitelman51d50f02017-12-10 18:55:03 +0200171}) as angular.IDirectiveFactory);
Michael Landoa5445102018-03-04 14:53:33 +0200172
Tal Gitelman51d50f02017-12-10 18:55:03 +0200173directiveModule.directive('topNav', downgradeComponent({
vasraz26e50292021-02-16 17:37:57 +0000174 component: TopNavComponent,
175 inputs: ['version', 'menuModel', 'topLvlSelectedIndex', 'hideSearch', 'searchTerm', 'notificationIconCallback', 'unsavedChanges', 'unsavedChangesCallback'],
176 outputs: ['searchTermChange']
Tal Gitelman51d50f02017-12-10 18:55:03 +0200177}) as ng.IDirectiveFactory);
Michael Landoa5445102018-03-04 14:53:33 +0200178
179directiveModule.directive('ng2ZoneContainer', downgradeComponent({
vasraz26e50292021-02-16 17:37:57 +0000180 component: ZoneContainerComponent,
181 inputs: ['title', 'count', 'type', 'visible', 'minimized'],
182 outputs: ['minimize', 'backgroundClick']
Michael Landoa5445102018-03-04 14:53:33 +0200183}) as angular.IDirectiveFactory);
184
185directiveModule.directive('ng2ZoneInstance', downgradeComponent({
vasraz26e50292021-02-16 17:37:57 +0000186 component: ZoneInstanceComponent,
187 inputs: ['zoneInstance', 'isActive', 'activeInstanceMode', 'defaultIconText', 'isViewOnly', 'hidden', 'forceSave'],
188 outputs: ['modeChange', 'tagHandleClick', 'assignmentSaveStart', 'assignmentSaveComplete']
Michael Lando5b593492018-07-29 16:13:45 +0300189}) as angular.IDirectiveFactory);
190
191directiveModule.directive('ng2CompositionPanel', downgradeComponent({
vasraz26e50292021-02-16 17:37:57 +0000192 component: CompositionPanelComponent,
193 inputs: ['isViewOnly', 'isLoading', 'isCertified', 'selectedZoneInstanceId', 'selectedZoneInstanceType', 'selectedZoneInstanceName', 'topologyTemplate'],
Michael Landoa5445102018-03-04 14:53:33 +0200194}) as angular.IDirectiveFactory);
195
196directiveModule.directive('propertiesAssignment', downgradeComponent({
vasraz26e50292021-02-16 17:37:57 +0000197 component: PropertiesAssignmentComponent
Michael Landoa5445102018-03-04 14:53:33 +0200198}) as angular.IDirectiveFactory);
199
ys969316a9fce2020-01-19 13:50:02 +0200200directiveModule.directive('compositionPage', downgradeComponent({
vasraz26e50292021-02-16 17:37:57 +0000201 component: CompositionPageComponent
ys969316a9fce2020-01-19 13:50:02 +0200202}) as angular.IDirectiveFactory);
203
204directiveModule.directive('activityLog', downgradeComponent({
vasraz26e50292021-02-16 17:37:57 +0000205 component: ActivityLogComponent
ys969316a9fce2020-01-19 13:50:02 +0200206}) as angular.IDirectiveFactory);
207
208directiveModule.directive('distribution', downgradeComponent({
vasraz26e50292021-02-16 17:37:57 +0000209 component: DistributionComponent
ys969316a9fce2020-01-19 13:50:02 +0200210}) as angular.IDirectiveFactory);
211
212directiveModule.directive('attributes', downgradeComponent({
vasraz26e50292021-02-16 17:37:57 +0000213 component: AttributesComponent
214}) as angular.IDirectiveFactory);
215
216directiveModule.directive('attributesOutputs', downgradeComponent({
217 component: AttributesOutputsComponent
ys969316a9fce2020-01-19 13:50:02 +0200218}) as angular.IDirectiveFactory);
219
220directiveModule.directive('reqAndCapabilities', downgradeComponent({
vasraz26e50292021-02-16 17:37:57 +0000221 component: ReqAndCapabilitiesComponent
ys969316a9fce2020-01-19 13:50:02 +0200222}) as angular.IDirectiveFactory);
223
Michael Landoa5445102018-03-04 14:53:33 +0200224directiveModule.directive('ng2SearchWithAutocomplete', downgradeComponent({
vasraz26e50292021-02-16 17:37:57 +0000225 component: SearchWithAutoCompleteComponent,
226 inputs: ['searchPlaceholder', 'searchBarClass', 'autoCompleteValues'],
227 outputs: ['searchChanged', 'searchButtonClicked']
Michael Landoa5445102018-03-04 14:53:33 +0200228}) as angular.IDirectiveFactory);
229
Michael Landoa5445102018-03-04 14:53:33 +0200230directiveModule.directive('ng2PalettePopupPanel', downgradeComponent({
vasraz26e50292021-02-16 17:37:57 +0000231 component: PalettePopupPanelComponent,
232 inputs: [],
233 outputs: []
Michael Landoa5445102018-03-04 14:53:33 +0200234}) as angular.IDirectiveFactory);
235
Michael Landoa5445102018-03-04 14:53:33 +0200236directiveModule.directive('ng2ServicePathSelector', downgradeComponent({
vasraz26e50292021-02-16 17:37:57 +0000237 component: ServicePathSelectorComponent,
238 inputs: ['drawPath', 'deletePaths', 'service', 'selectedPathId'],
239 outputs: []
Michael Landoa5445102018-03-04 14:53:33 +0200240}) as angular.IDirectiveFactory);
Idan Amit7363f3d2018-03-21 12:04:57 +0200241
Ofir Sonsino2c579cb2020-03-22 10:46:13 +0200242directiveModule.directive('interfaceOperation', downgradeComponent({
vasraz26e50292021-02-16 17:37:57 +0000243 component: InterfaceOperationComponent,
244 inputs: ['component', 'readonly'],
245 outputs: []
Arielk802bd2a2018-04-16 15:37:39 +0300246}) as angular.IDirectiveFactory);
247
Michael Lando5b593492018-07-29 16:13:45 +0300248directiveModule.directive('ng2MultilineEllipsis', downgradeComponent({
vasraz26e50292021-02-16 17:37:57 +0000249 component: MultilineEllipsisComponent,
250 inputs: ['lines', 'lineHeight', 'className'],
251 outputs: ['hasEllipsisChanged']
Michael Lando5b593492018-07-29 16:13:45 +0300252}) as angular.IDirectiveFactory);
253
254directiveModule.directive('ng2UiTile', downgradeComponent({
vasraz26e50292021-02-16 17:37:57 +0000255 component: TileComponent,
256 inputs: ['component'],
257 outputs: ['onTileClick']
Michael Lando5b593492018-07-29 16:13:45 +0300258}) as angular.IDirectiveFactory);
259
ys969316a9fce2020-01-19 13:50:02 +0200260directiveModule.directive('pluginFrame', downgradeComponent({
vasraz26e50292021-02-16 17:37:57 +0000261 component: PluginFrameComponent,
262 inputs: ['plugin', 'queryParams'],
263 outputs: ['onLoadingDone']
Idan Amit7363f3d2018-03-21 12:04:57 +0200264}) as angular.IDirectiveFactory);
ys969316a9fce2020-01-19 13:50:02 +0200265
266directiveModule.directive('catalogPage', downgradeComponent({
vasraz26e50292021-02-16 17:37:57 +0000267 component: CatalogComponent,
268 inputs: [],
269 outputs: []
ys969316a9fce2020-01-19 13:50:02 +0200270}) as angular.IDirectiveFactory);
271
272directiveModule.directive('homePage', downgradeComponent({
vasraz26e50292021-02-16 17:37:57 +0000273 component: HomeComponent,
274 inputs: [],
275 outputs: []
ys969316a9fce2020-01-19 13:50:02 +0200276}) as angular.IDirectiveFactory);
277
278directiveModule.directive('pluginContextView', downgradeComponent({
vasraz26e50292021-02-16 17:37:57 +0000279 component: PluginContextViewPageComponent,
280 inputs: [],
281 outputs: []
ys969316a9fce2020-01-19 13:50:02 +0200282}) as angular.IDirectiveFactory);
283
284directiveModule.directive('pluginTabView', downgradeComponent({
vasraz26e50292021-02-16 17:37:57 +0000285 component: PluginTabViewPageComponent,
286 inputs: [],
287 outputs: []
ys969316a9fce2020-01-19 13:50:02 +0200288}) as angular.IDirectiveFactory);
289
290directiveModule.directive('compositionGraph', downgradeComponent({
vasraz26e50292021-02-16 17:37:57 +0000291 component: CompositionGraphComponent,
292 inputs: ['topologyTemplate', 'isViewOnly'],
293 outputs: []
ys969316a9fce2020-01-19 13:50:02 +0200294}) as angular.IDirectiveFactory);
295directiveModule.directive('toscaArtifactPage', downgradeComponent({
vasraz26e50292021-02-16 17:37:57 +0000296 component: ToscaArtifactPageComponent,
297 inputs: [],
298 outputs: []
ys969316a9fce2020-01-19 13:50:02 +0200299}) as angular.IDirectiveFactory);
300
301directiveModule.directive('deploymentPage', downgradeComponent({
vasraz26e50292021-02-16 17:37:57 +0000302 component: DeploymentPageComponent,
303 inputs: [],
304 outputs: []
ys969316a9fce2020-01-19 13:50:02 +0200305}) as angular.IDirectiveFactory);
306
307directiveModule.directive('informationArtifactPage', downgradeComponent({
vasraz26e50292021-02-16 17:37:57 +0000308 component: InformationArtifactPageComponent,
309 inputs: [],
310 outputs: []
ys969316a9fce2020-01-19 13:50:02 +0200311}) as angular.IDirectiveFactory);
312directiveModule.directive('deploymentArtifactPage', downgradeComponent({
vasraz26e50292021-02-16 17:37:57 +0000313 component: DeploymentArtifactsPageComponent,
314 inputs: [],
315 outputs: []
ys969316a9fce2020-01-19 13:50:02 +0200316}) as angular.IDirectiveFactory);